domain
stringclasses
1 value
text
stringlengths
42.5k
494k
length
int64
41.5k
168k
thestackv1_concat_by_repo-long/65536-65536
11}, /* 72: 0111 0100 0111 0010 xxxx xxxx */ {SBI,"C,%b", 3,11}, /* 73: 0111 0100 0111 0011 xxxx xxxx */ {SBI,"D,%b", 3,11}, /* 74: 0111 0100 0111 0100 xxxx xxxx */ {SBI,"E,%b", 3,11}, /* 75: 0111 0100 0111 0101 xxxx xxxx */ {SBI,"H,%b", 3,11}, /* 76: 0111 0100 0111 0110 xxxx xxxx */ {SBI,"L,%b", 3,11}, /* 77: 0111 0100 0111 0111 xxxx xxxx */ {EQI,"V,%b", 3,11}, /* 78: 0111 0100 0111 1000 xxxx xxxx */ {EQI,"A,%b", 3,11}, /* 79: 0111 0100 0111 1001 xxxx xxxx */ {EQI,"B,%b", 3,11}, /* 7a: 0111 0100 0111 1010 xxxx xxxx */ {EQI,"C,%b", 3,11}, /* 7b: 0111 0100 0111 1011 xxxx xxxx */ {EQI,"D,%b", 3,11}, /* 7c: 0111 0100 0111 1100 xxxx xxxx */ {EQI,"E,%b", 3,11}, /* 7d: 0111 0100 0111 1101 xxxx xxxx */ {EQI,"H,%b", 3,11}, /* 7e: 0111 0100 0111 1110 xxxx xxxx */ {EQI,"L,%b", 3,11}, /* 7f: 0111 0100 0111 1111 xxxx xxxx */ {illegal,0, 2, 8}, /* 80: 0111 0100 1000 0000 */ {illegal,0, 2, 8}, /* 81: 0111 0100 1000 0001 */ {illegal,0, 2, 8}, /* 82: 0111 0100 1000 0010 */ {illegal,0, 2, 8}, /* 83: 0111 0100 1000 0011 */ {illegal,0, 2, 8}, /* 84: 0111 0100 1000 0100 */ {illegal,0, 2, 8}, /* 85: 0111 0100 1000 0101 */ {illegal,0, 2, 8}, /* 86: 0111 0100 1000 0110 */ {illegal,0, 2, 8}, /* 87: 0111 0100 1000 0111 */ {ANAW,"%a", 3,14}, /* 88: 0111 0100 1000 1000 oooo oooo */ {illegal,0, 2, 8}, /* 89: 0111 0100 1000 1001 */ {illegal,0, 2, 8}, /* 8a: 0111 0100 1000 1010 */ {illegal,0, 2, 8}, /* 8b: 0111 0100 1000 1011 */ {illegal,0, 2, 8}, /* 8c: 0111 0100 1000 1100 */ {DAN,"EA,BC", 2,11}, /* 8d: 0111 0100 1000 1101 */ {DAN,"EA,DE", 2,11}, /* 8e: 0111 0100 1000 1110 */ {DAN,"EA,HL", 2,11}, /* 8f: 0111 0100 1000 1111 */ {XRAW,"%a", 3,14}, /* 90: 0111 0100 1001 0000 oooo oooo */ {illegal,0, 2, 8}, /* 91: 0111 0100 1001 0001 */ {illegal,0, 2, 8}, /* 92: 0111 0100 1001 0010 */ {illegal,0, 2, 8}, /* 93: 0111 0100 1001 0011 */ {illegal,0, 2, 8}, /* 94: 0111 0100 1001 0100 */ {DXR,"EA,BC", 2,11}, /* 95: 0111 0100 1001 0101 */ {DXR,"EA,DE", 2,11}, /* 96: 0111 0100 1001 0110 */ {DXR,"EA,HL", 2,11}, /* 97: 0111 0100 1001 0111 */ {ORAW,"%a", 3,14}, /* 98: 0111 0100 1001 1000 oooo oooo */ {illegal,0, 2, 8}, /* 99: 0111 0100 1001 1001 */ {illegal,0, 2, 8}, /* 9a: 0111 0100 1001 1010 */ {illegal,0, 2, 8}, /* 9b: 0111 0100 1001 1011 */ {illegal,0, 2, 8}, /* 9c: 0111 0100 1001 1100 */ {DOR,"EA,BC", 2,11}, /* 9d: 0111 0100 1001 1101 */ {DOR,"EA,DE", 2,11}, /* 9e: 0111 0100 1001 1110 */ {DOR,"EA,HL", 2,11}, /* 9f: 0111 0100 1001 1111 */ {ADDNCW,"%a", 3,14}, /* a0: 0111 0100 1010 0000 oooo oooo */ {illegal,0, 2, 8}, /* a1: 0111 0100 1010 0001 */ {illegal,0, 2, 8}, /* a2: 0111 0100 1010 0010 */ {illegal,0, 2, 8}, /* a3: 0111 0100 1010 0011 */ {illegal,0, 2, 8}, /* a4: 0111 0100 1010 0100 */ {DADDNC,"EA,BC", 2,11}, /* a5: 0111 0100 1010 0101 */ {DADDNC,"EA,DE", 2,11}, /* a6: 0111 0100 1010 0110 */ {DADDNC,"EA,HL", 2,11}, /* a7: 0111 0100 1010 0111 */ {GTAW,"%a", 3,14}, /* a8: 0111 0100 1010 1000 oooo oooo */ {illegal,0, 2, 8}, /* a9: 0111 0100 1010 1001 */ {illegal,0, 2, 8}, /* aa: 0111 0100 1010 1010 */ {illegal,0, 2, 8}, /* ab: 0111 0100 1010 1011 */ {illegal,0, 2, 8}, /* ac: 0111 0100 1010 1100 */ {DGT,"EA,BC", 2,11}, /* ad: 0111 0100 1010 1101 */ {DGT,"EA,DE", 2,11}, /* ae: 0111 0100 1010 1110 */ {DGT,"EA,HL", 2,11}, /* af: 0111 0100 1010 1111 */ {SUBNBW,"%a", 3,14}, /* b0: 0111 0100 1011 0000 oooo oooo */ {illegal,0, 2, 8}, /* b1: 0111 0100 1011 0001 */ {illegal,0, 2, 8}, /* b2: 0111 0100 1011 0010 */ {illegal,0, 2, 8}, /* b3: 0111 0100 1011 0011 */ {illegal,0, 2, 8}, /* b4: 0111 0100 1011 0100 */ {DSUBNB,"EA,BC", 2,11}, /* b5: 0111 0100 1011 0101 */ {DSUBNB,"EA,DE", 2,11}, /* b6: 0111 0100 1011 0110 */ {DSUBNB,"EA,HL", 2,11}, /* b7: 0111 0100 1011 0111 */ {LTAW,"%a", 3,14}, /* b8: 0111 0100 1011 1000 oooo oooo */ {illegal,0, 2, 8}, /* b9: 0111 0100 1011 1001 */ {illegal,0, 2, 8}, /* ba: 0111 0100 1011 1010 */ {illegal,0, 2, 8}, /* bb: 0111 0100 1011 1011 */ {illegal,0, 2, 8}, /* bc: 0111 0100 1011 1100 */ {DLT,"EA,BC", 2,11}, /* bd: 0111 0100 1011 1101 */ {DLT,"EA,DE", 2,11}, /* be: 0111 0100 1011 1110 */ {DLT,"EA,HL", 2,11}, /* bf: 0111 0100 1011 1111 */ {ADDW,"%a", 3,14}, /* c0: 0111 0100 1100 0000 oooo oooo */ {illegal,0, 2, 8}, /* c1: 0111 0100 1100 0001 */ {illegal,0, 2, 8}, /* c2: 0111 0100 1100 0010 */ {illegal,0, 2, 8}, /* c3: 0111 0100 1100 0011 */ {illegal,0, 2, 8}, /* c4: 0111 0100 1100 0100 */ {DADD,"EA,BC", 2,11}, /* c5: 0111 0100 1100 0101 */ {DADD,"EA,DE", 2,11}, /* c6: 0111 0100 1100 0110 */ {DADD,"EA,HL", 2,11}, /* c7: 0111 0100 1100 0111 */ {ONAW,"%a", 3,14}, /* c8: 0111 0100 1100 1000 oooo oooo */ {illegal,0, 2, 8}, /* c9: 0111 0100 1100 1001 */ {illegal,0, 2, 8}, /* ca: 0111 0100 1100 1010 */ {illegal,0, 2, 8}, /* cb: 0111 0100 1100 1011 */ {illegal,0, 2, 8}, /* cc: 0111 0100 1100 1100 */ {DON,"EA,BC", 2,11}, /* cd: 0111 0100 1100 1101 */ {DON,"EA,DE", 2,11}, /* ce: 0111 0100 1100 1110 */ {DON,"EA,HL", 2,11}, /* cf: 0111 0100 1100 1111 */ {ADCW,"%a", 3,14}, /* d0: 0111 0100 1101 0000 oooo oooo */ {illegal,0, 2, 8}, /* d1: 0111 0100 1101 0001 */ {illegal,0, 2, 8}, /* d2: 0111 0100 1101 0010 */ {illegal,0, 2, 8}, /* d3: 0111 0100 1101 0011 */ {illegal,0, 2, 8}, /* d4: 0111 0100 1101 0100 */ {DADC,"EA,BC", 2,11}, /* d5: 0111 0100 1101 0101 */ {DADC,"EA,DE", 2,11}, /* d6: 0111 0100 1101 0110 */ {DADC,"EA,HL", 2,11}, /* d7: 0111 0100 1101 0111 */ {OFFAW,"%a", 3,14}, /* d8: 0111 0100 1101 1000 oooo oooo */ {illegal,0, 2, 8}, /* d9: 0111 0100 1101 1001 */ {illegal,0, 2, 8}, /* da: 0111 0100 1101 1010 */ {illegal,0, 2, 8}, /* db: 0111 0100 1101 1011 */ {illegal,0, 2, 8}, /* dc: 0111 0100 1101 1100 */ {DOFF,"EA,BC", 2,11}, /* dd: 0111 0100 1101 1101 */ {DOFF,"EA,DE", 2,11}, /* de: 0111 0100 1101 1110 */ {DOFF,"EA,HL", 2,11}, /* df: 0111 0100 1101 1111 */ {SUBW,"%a", 3,14}, /* e0: 0111 0100 1110 0000 oooo oooo */ {illegal,0, 2, 8}, /* e1: 0111 0100 1110 0001 */ {illegal,0, 2, 8}, /* e2: 0111 0100 1110 0010 */ {illegal,0, 2, 8}, /* e3: 0111 0100 1110 0011 */ {illegal,0, 2, 8}, /* e4: 0111 0100 1110 0100 */ {DSUB,"EA,BC", 2,11}, /* e5: 0111 0100 1110 0101 */ {DSUB,"EA,DE", 2,11}, /* e6: 0111 0100 1110 0110 */ {DSUB,"EA,HL", 2,11}, /* e7: 0111 0100 1110 0111 */ {NEAW,"%a", 3,14}, /* e8: 0111 0100 1110 1000 oooo oooo */ {illegal,0, 2, 8}, /* e9: 0111 0100 1110 1001 */ {illegal,0, 2, 8}, /* ea: 0111 0100 1110 1010 */ {illegal,0, 2, 8}, /* eb: 0111 0100 1110 1011 */ {illegal,0, 2, 8}, /* ec: 0111 0100 1110 1100 */ {DNE,"EA,BC", 2,11}, /* ed: 0111 0100 1110 1101 */ {DNE,"EA,DE", 2,11}, /* ee: 0111 0100 1110 1110 */ {DNE,"EA,HL", 2,11}, /* ef: 0111 0100 1110 1111 */ {SBBW,"%a", 3,14}, /* f0: 0111 0100 1111 0000 oooo oooo */ {illegal,0, 2, 8}, /* f1: 0111 0100 1111 0001 */ {illegal,0, 2, 8}, /* f2: 0111 0100 1111 0010 */ {illegal,0, 2, 8}, /* f3: 0111 0100 1111 0011 */ {illegal,0, 2, 8}, /* f4: 0111 0100 1111 0100 */ {DSBB,"EA,BC", 2,11}, /* f5: 0111 0100 1111 0101 */ {DSBB,"EA,DE", 2,11}, /* f6: 0111 0100 1111 0110 */ {DSBB,"EA,HL", 2,11}, /* f7: 0111 0100 1111 0111 */ {EQAW,"%a", 3,14}, /* f8: 0111 0100 1111 1000 oooo oooo */ {illegal,0, 2, 8}, /* f9: 0111 0100 1111 1001 */ {illegal,0, 2, 8}, /* fa: 0111 0100 1111 1010 */ {illegal,0, 2, 8}, /* fb: 0111 0100 1111 1011 */ {illegal,0, 2, 8}, /* fc: 0111 0100 1111 1100 */ {DEQ,"EA,BC", 2,11}, /* fd: 0111 0100 1111 1101 */ {DEQ,"EA,DE", 2,11}, /* fe: 0111 0100 1111 1110 */ {DEQ,"EA,HL", 2,11} /* ff: 0111 0100 1111 1111 */ }; /* main opcodes */ static struct dasm_s dasmXX_7810[256] = { {NOP,0, 1, 4}, /* 00: 0000 0000 */ {LDAW,"%a", 2,10}, /* 01: 0000 0001 oooo oooo */ {INX,"SP", 1, 7}, /* 02: 0000 0010 */ {DCX,"SP", 1, 7}, /* 03: 0000 0011 */ {LXI,"SP,%w", 3,10}, /* 04: 0000 0100 llll llll hhhh hhhh */ {ANIW,"%a,%b", 3,19}, /* 05: 0000 0101 oooo oooo xxxx xxxx */ {illegal,0, 1, 4}, /* 06: */ {ANI,"A,%b", 2, 7}, /* 07: 0000 0111 xxxx xxxx */ {MOV,"A,EAH", 1, 4}, /* 08: 0000 1000 */ {MOV,"A,EAL", 1, 4}, /* 09: 0000 1001 */ {MOV,"A,B", 1, 4}, /* 0a: 0000 1010 */ {MOV,"A,C", 1, 4}, /* 0b: 0000 1011 */ {MOV,"A,D", 1, 4}, /* 0c: 0000 1100 */ {MOV,"A,E", 1, 4}, /* 0d: 0000 1101 */ {MOV,"A,H", 1, 4}, /* 0e: 0000 1110 */ {MOV,"A,L", 1, 4}, /* 0f: 0000 1111 */ {EXA,0, 1, 4}, /* 10: 0001 0000 */ /* 7810 */ {EXX,0, 1, 4}, /* 11: 0001 0001 */ /* 7810 */ {INX,"BC", 1, 7}, /* 12: 0001 0010 */ {DCX,"BC", 1, 7}, /* 13: 0001 0011 */ {LXI,"BC,%w", 3,10}, /* 14: 0001 0100 llll llll hhhh hhhh */ {ORIW,"%a,%b", 3,19}, /* 15: 0001 0101 oooo oooo xxxx xxxx */ {XRI,"A,%b", 2, 7}, /* 16: 0001 0110 xxxx xxxx */ {ORI,"A,%b", 2, 7}, /* 17: 0001 0111 xxxx xxxx */ {MOV,"EAH,A", 1, 4}, /* 18: 0001 1000 */ {MOV,"EAL,A", 1, 4}, /* 19: 0001 1001 */ {MOV,"B,A", 1, 4}, /* 1a: 0001 1010 */ {MOV,"C,A", 1, 4}, /* 1b: 0001 1011 */ {MOV,"D,A", 1, 4}, /* 1c: 0001 1100 */ {MOV,"E,A", 1, 4}, /* 1d: 0001 1101 */ {MOV,"H,A", 1, 4}, /* 1e: 0001 1110 */ {MOV,"L,A", 1, 4}, /* 1f: 0001 1111 */ {INRW,"%a", 2,16}, /* 20: 0010 0000 oooo oooo */ {JB,0, 1, 4}, /* 21: 0010 0001 */ {INX,"DE", 1, 7}, /* 22: 0010 0010 */ {DCX,"DE", 1, 7}, /* 23: 0010 0011 */ {LXI,"DE,%w", 3,10}, /* 24: 0010 0100 llll llll hhhh hhhh */ {GTIW,"%a,%b", 3,19}, /* 25: 0010 0101 oooo oooo xxxx xxxx */ {ADINC,"A,%b", 2, 7}, /* 26: 0010 0110 xxxx xxxx */ {GTI,"A,%b", 2, 7}, /* 27: 0010 0111 xxxx xxxx */ {illegal,0, 1, 4}, /* 28: 0010 1000 */ {LDAX,"(BC)", 1, 7}, /* 29: 0010 1001 */ {LDAX,"(DE)", 1, 7}, /* 2a: 0010 1010 */ {LDAX,"(HL)", 1, 7}, /* 2b: 0010 1011 */ {LDAX,"(DE+)", 1, 7}, /* 2c: 0010 1100 */ {LDAX,"(HL+)", 1, 7}, /* 2d: 0010 1101 */ {LDAX,"(DE-)", 1, 7}, /* 2e: 0010 1110 */ {LDAX,"(HL-)", 1, 7}, /* 2f: 0010 1111 */ {DCRW,"%a", 2,16}, /* 30: 0011 0000 oooo oooo */ {BLOCK,0, 1,13}, /* 31: 0011 0001 */ /* 7810 */ {INX,"HL", 1, 7}, /* 32: 0011 0010 */ {DCX,"HL", 1, 7}, /* 33: 0011 0011 */ {LXI,"HL,%w", 3,10}, /* 34: 0011 0100 llll llll hhhh hhhh */ {LTIW,"%a,%b", 3,19}, /* 35: 0011 0101 oooo oooo xxxx xxxx */ {SUINB,"A,%b", 2, 7}, /* 36: 0011 0110 xxxx xxxx */ {LTI,"A,%b", 2, 7}, /* 37: 0011 0111 xxxx xxxx */ {illegal,0, 1, 4}, /* 38: */ {STAX,"(BC)", 1, 7}, /* 39: 0011 1001 */ {STAX,"(DE)", 1, 7}, /* 3a: 0011 1010 */ {STAX,"(HL)", 1, 7}, /* 3b: 0011 1011 */ {STAX,"(DE+)", 1, 7}, /* 3c: 0011 1100 */ {STAX,"(HL+)", 1, 7}, /* 3d: 0011 1101 */ {STAX,"(DE-)", 1, 7}, /* 3e: 0011 1110 */ {STAX,"(HL-)", 1, 7}, /* 3f: 0011 1111 */ {CALL,"%w", 3,16}, /* 40: 0100 0000 llll llll hhhh hhhh */ {INR,"A", 1, 4}, /* 41: 0100 0001 */ {INR,"B", 1, 4}, /* 42: 0100 0010 */ {INR,"C", 1, 4}, /* 43: 0100 0011 */ {LXI,"EA,%w", 3,10}, /* 44: 0100 0100 llll llll hhhh hhhh */ {ONIW,"%a,%b", 3,19}, /* 45: 0100 0101 oooo oooo xxxx xxxx */ {ADI,"A,%b", 2, 7}, /* 46: 0100 0110 xxxx xxxx */ {ONI,"A,%b", 2, 7}, /* 47: 0100 0111 xxxx xxxx */ {0,dasm48_7810, 0, 0}, /* 48: prefix */ {MVIX,"BC,%b", 2,10}, /* 49: 0100 1001 xxxx xxxx */ {MVIX,"DE,%b", 2,10}, /* 4a: 0100 1010 xxxx xxxx */ {MVIX,"HL,%b", 2,10}, /* 4b: 0100 1011 xxxx xxxx */ {0,dasm4C_7810, 0, 0}, /* 4c: prefix */ {0,dasm4D_7810, 0, 0}, /* 4d: prefix */ {JRE,"%d", 2,10}, /* 4e: 0100 111d dddd dddd */ {JRE,"%d", 2,10}, /* 4f: 0100 111d dddd dddd */ {EXH,0, 1, 4}, /* 50: 0101 0000 */ /* 7810 */ {DCR,"A", 1, 4}, /* 51: 0101 0001 */ {DCR,"B", 1, 4}, /* 52: 0101 0010 */ {DCR,"C", 1, 4}, /* 53: 0101 0011 */ {JMP,"%w", 3,10}, /* 54: 0101 0100 llll llll hhhh hhhh */ {OFFIW,"%a,%b", 3,19}, /* 55: 0101 0101 oooo oooo xxxx xxxx */ {ACI,"A,%b", 2, 7}, /* 56: 0101 0110 xxxx xxxx */ {OFFI,"A,%b", 2, 7}, /* 57: 0101 0111 xxxx xxxx */ {BIT,"0,%a", 2,10}, /* 58: 0101 1000 oooo oooo */ /* 7810 */ {BIT,"1,%a", 2,10}, /* 59: 0101 1001 oooo oooo */ /* 7810 */ {BIT,"2,%a", 2,10}, /* 5a: 0101 1010 oooo oooo */ /* 7810 */ {BIT,"3,%a", 2,10}, /* 5b: 0101 1011 oooo oooo */ /* 7810 */ {BIT,"4,%a", 2,10}, /* 5c: 0101 1100 oooo oooo */ /* 7810 */ {BIT,"5,%a", 2,10}, /* 5d: 0101 1101 oooo oooo */ /* 7810 */ {BIT,"6,%a", 2,10}, /* 5e: 0101 1110 oooo oooo */ /* 7810 */ {BIT,"7,%a", 2,10}, /* 5f: 0101 1111 oooo oooo */ /* 7810 */ {0,dasm60, 0, 0}, /* 60: prefix */ {DAA,0, 1, 4}, /* 61: 0110 0001 */ {RETI,0, 1,13}, /* 62: 0110 0010 */ {STAW,"%a", 2,10}, /* 63: 0110 0011 oooo oooo */ {0,dasm64_7810, 0, 0}, /* 64: prefix */ {NEIW,"%a,%b", 3,19}, /* 65: 0110 0101 oooo oooo xxxx xxxx */ {SUI,"A,%b", 2, 7}, /* 66: 0110 0110 xxxx xxxx */ {NEI,"A,%b", 2, 7}, /* 67: 0110 0111 xxxx xxxx */ {MVI,"V,%b", 2, 7}, /* 68: 0110 1000 xxxx xxxx */ {MVI,"A,%b", 2, 7}, /* 69: 0110 1001 xxxx xxxx */ {MVI,"B,%b", 2, 7}, /* 6a: 0110 1010 xxxx xxxx */ {MVI,"C,%b", 2, 7}, /* 6b: 0110 1011 xxxx xxxx */ {MVI,"D,%b", 2, 7}, /* 6c: 0110 1100 xxxx xxxx */ {MVI,"E,%b", 2, 7}, /* 6d: 0110 1101 xxxx xxxx */ {MVI,"H,%b", 2, 7}, /* 6e: 0110 1110 xxxx xxxx */ {MVI,"L,%b", 2, 7}, /* 6f: 0110 1111 xxxx xxxx */ {0,dasm70, 0, 0}, /* 70: prefix */ {MVIW,"%a,%b", 3,13}, /* 71: 0111 0001 oooo oooo xxxx xxxx */ {SOFTI,0, 1,16}, /* 72: 0111 0010 */ {illegal,0, 1, 0}, /* 73: */ {0,dasm74, 0, 0}, /* 74: prefix */ {EQIW,"%a,%b", 3,19}, /* 75: 0111 0101 oooo oooo xxxx xxxx */ {SBI,"A,%b", 2, 7}, /* 76: 0111 0110 xxxx xxxx */ {EQI,"A,%b", 2, 7}, /* 77: 0111 0111 xxxx xxxx */ {CALF,"%f", 2,13}, /* 78: 0111 1ddd dddd dddd */ {CALF,"%f", 2,13}, /* 79: 0111 1ddd dddd dddd */ {CALF,"%f", 2,13}, /* 7a: 0111 1ddd dddd dddd */ {CALF,"%f", 2,13}, /* 7b: 0111 1ddd dddd dddd */ {CALF,"%f", 2,13}, /* 7c: 0111 1ddd dddd dddd */ {CALF,"%f", 2,13}, /* 7d: 0111 1ddd dddd dddd */ {CALF,"%f", 2,13}, /* 7e: 0111 1ddd dddd dddd */ {CALF,"%f", 2,13}, /* 7f: 0111 1ddd dddd dddd */ {CALT,"%t", 1,16}, /* 80: 100t tttt */ {CALT,"%t", 1,16}, /* 81: 100t tttt */ {CALT,"%t", 1,16}, /* 82: 100t tttt */ {CALT,"%t", 1,16}, /* 83: 100t tttt */ {CALT,"%t", 1,16}, /* 84: 100t tttt */ {CALT,"%t", 1,16}, /* 85: 100t tttt */ {CALT,"%t", 1,16}, /* 86: 100t tttt */ {CALT,"%t", 1,16}, /* 87: 100t tttt */ {CALT,"%t", 1,16}, /* 88: 100t tttt */ {CALT,"%t", 1,16}, /* 89: 100t tttt */ {CALT,"%t", 1,16}, /* 8a: 100t tttt */ {CALT,"%t", 1,16}, /* 8b: 100t tttt */ {CALT,"%t", 1,16}, /* 8c: 100t tttt */ {CALT,"%t", 1,16}, /* 8d: 100t tttt */ {CALT,"%t", 1,16}, /* 8e: 100t tttt */ {CALT,"%t", 1,16}, /* 8f: 100t tttt */ {CALT,"%t", 1,16}, /* 90: 100t tttt */ {CALT,"%t", 1,16}, /* 91: 100t tttt */ {CALT,"%t", 1,16}, /* 92: 100t tttt */ {CALT,"%t", 1,16}, /* 93: 100t tttt */ {CALT,"%t", 1,16}, /* 94: 100t tttt */ {CALT,"%t", 1,16}, /* 95: 100t tttt */ {CALT,"%t", 1,16}, /* 96: 100t tttt */ {CALT,"%t", 1,16}, /* 97: 100t tttt */ {CALT,"%t", 1,16}, /* 98: 100t tttt */ {CALT,"%t", 1,16}, /* 99: 100t tttt */ {CALT,"%t", 1,16}, /* 9a: 100t tttt */ {CALT,"%t", 1,16}, /* 9b: 100t tttt */ {CALT,"%t", 1,16}, /* 9c: 100t tttt */ {CALT,"%t", 1,16}, /* 9d: 100t tttt */ {CALT,"%t", 1,16}, /* 9e: 100t tttt */ {CALT,"%t", 1,16}, /* 9f: 100t tttt */ {POP,"VA", 1,10}, /* a0: 1010 0000 */ {POP,"BC", 1,10}, /* a1: 1010 0001 */ {POP,"DE", 1,10}, /* a2: 1010 0010 */ {POP,"HL", 1,10}, /* a3: 1010 0011 */ {POP,"EA", 1,10}, /* a4: 1010 0100 */ {DMOV,"EA,BC", 1, 4}, /* a5: 1010 0101 */ {DMOV,"EA,DE", 1, 4}, /* a6: 1010 0110 */ {DMOV,"EA,HL", 1, 4}, /* a7: 1010 0111 */ {INX,"EA", 1, 7}, /* a8: 1010 1000 */ {DCX,"EA", 1, 7}, /* a9: 1010 1001 */ {EI,0, 1, 4}, /* aa: 1010 1010 */ {LDAX,"(DE+%b)", 2,13}, /* ab: 1010 1011 dddd dddd */ {LDAX,"(HL+A)", 1,13}, /* ac: 1010 1100 */ {LDAX,"(HL+B)", 1,13}, /* ad: 1010 1101 */ {LDAX,"(HL+EA)", 1,13}, /* ae: 1010 1110 */ {LDAX,"(HL+%b)", 2,13}, /* af: 1010 1111 dddd dddd */ {PUSH,"VA", 1,13}, /* b0: 1011 0000 */ {PUSH,"BC", 1,13}, /* b1: 1011 0001 */ {PUSH,"DE", 1,13}, /* b2: 1011 0010 */ {PUSH,"HL", 1,13}, /* b3: 1011 0011 */ {PUSH,"EA", 1,13}, /* b4: 1011 0100 */ {DMOV,"BC,EA", 1, 4}, /* b5: 1011 0101 */ {DMOV,"DE,EA", 1, 4}, /* b6: 1011 0110 */ {DMOV,"HL,EA", 1, 4}, /* b7: 1011 0111 */ {RET,0, 1,10}, /* b8: 1011 1000 */ {RETS,0, 1,10}, /* b9: 1011 1001 */ {DI,0, 1, 4}, /* ba: 1011 1010 */ {STAX,"(DE+%b)", 2,13}, /* bb: 1011 1011 dddd dddd */ {STAX,"(HL+A)", 1,13}, /* bc: 1011 1100 */ {STAX,"(HL+B)", 1,13}, /* bd: 1011 1101 */ {STAX,"(HL+EA)", 1,13}, /* be: 1011 1110 */ {STAX,"(HL+%b)", 2,13}, /* bf: 1011 1111 dddd dddd */ {JR,"%o", 1,10}, /* c0: 11oo oooo */ {JR,"%o", 1,10}, /* c1: 11oo oooo */ {JR,"%o", 1,10}, /* c2: 11oo oooo */ {JR,"%o", 1,10}, /* c3: 11oo oooo */ {JR,"%o", 1,10}, /* c4: 11oo oooo */ {JR,"%o", 1,10}, /* c5: 11oo oooo */ {JR,"%o", 1,10}, /* c6: 11oo oooo */ {JR,"%o", 1,10}, /* c7: 11oo oooo */ {JR,"%o", 1,10}, /* c8: 11oo oooo */ {JR,"%o", 1,10}, /* c9: 11oo oooo */ {JR,"%o", 1,10}, /* ca: 11oo oooo */ {JR,"%o", 1,10}, /* cb: 11oo oooo */ {JR,"%o", 1,10}, /* cc: 11oo oooo */ {JR,"%o", 1,10}, /* cd: 11oo oooo */ {JR,"%o", 1,10}, /* ce: 11oo oooo */ {JR,"%o", 1,10}, /* cf: 11oo oooo */ {JR,"%o", 1,10}, /* d0: 11oo oooo */ {JR,"%o", 1,10}, /* d1: 11oo oooo */ {JR,"%o", 1,10}, /* d2: 11oo oooo */ {JR,"%o", 1,10}, /* d3: 11oo oooo */ {JR,"%o", 1,10}, /* d4: 11oo oooo */ {JR,"%o", 1,10}, /* d5: 11oo oooo */ {JR,"%o", 1,10}, /* d6: 11oo oooo */ {JR,"%o", 1,10}, /* d7: 11oo oooo */ {JR,"%o", 1,10}, /* d8: 11oo oooo */ {JR,"%o", 1,10}, /* d9: 11oo oooo */ {JR,"%o", 1,10}, /* da: 11oo oooo */ {JR,"%o", 1,10}, /* db: 11oo oooo */ {JR,"%o", 1,10}, /* dc: 11oo oooo */ {JR,"%o", 1,10}, /* dd: 11oo oooo */ {JR,"%o", 1,10}, /* de: 11oo oooo */ {JR,"%o", 1,10}, /* df: 11oo oooo */ {JR,"%o", 1,10}, /* e0: 11oo oooo */ {JR,"%o", 1,10}, /* e1: 11oo oooo */ {JR,"%o", 1,10}, /* e2: 11oo oooo */ {JR,"%o", 1,10}, /* e3: 11oo oooo */ {JR,"%o", 1,10}, /* e4: 11oo oooo */ {JR,"%o", 1,10}, /* e5: 11oo oooo */ {JR,"%o", 1,10}, /* e6: 11oo oooo */ {JR,"%o", 1,10}, /* e7: 11oo oooo */ {JR,"%o", 1,10}, /* e8: 11oo oooo */ {JR,"%o", 1,10}, /* e9: 11oo oooo */ {JR,"%o", 1,10}, /* ea: 11oo oooo */ {JR,"%o", 1,10}, /* eb: 11oo oooo */ {JR,"%o", 1,10}, /* ec: 11oo oooo */ {JR,"%o", 1,10}, /* ed: 11oo oooo */ {JR,"%o", 1,10}, /* ee: 11oo oooo */ {JR,"%o", 1,10}, /* ef: 11oo oooo */ {JR,"%o", 1,10}, /* f0: 11oo oooo */ {JR,"%o", 1,10}, /* f1: 11oo oooo */ {JR,"%o", 1,10}, /* f2: 11oo oooo */ {JR,"%o", 1,10}, /* f3: 11oo oooo */ {JR,"%o", 1,10}, /* f4: 11oo oooo */ {JR,"%o", 1,10}, /* f5: 11oo oooo */ {JR,"%o", 1,10}, /* f6: 11oo oooo */ {JR,"%o", 1,10}, /* f7: 11oo oooo */ {JR,"%o", 1,10}, /* f8: 11oo oooo */ {JR,"%o", 1,10}, /* f9: 11oo oooo */ {JR,"%o", 1,10}, /* fa: 11oo oooo */ {JR,"%o", 1,10}, /* fb: 11oo oooo */ {JR,"%o", 1,10}, /* fc: 11oo oooo */ {JR,"%o", 1,10}, /* fd: 11oo oooo */ {JR,"%o", 1,10}, /* fe: 11oo oooo */ {JR,"%o", 1,10} /* ff: 11oo oooo */ }; static struct dasm_s dasmXX_7807[256] = { {NOP,0, 1, 4}, /* 00: 0000 0000 */ {LDAW,"%a", 2,10}, /* 01: 0000 0001 oooo oooo */ {INX,"SP", 1, 7}, /* 02: 0000 0010 */ {DCX,"SP", 1, 7}, /* 03: 0000 0011 */ {LXI,"SP,%w", 3,10}, /* 04: 0000 0100 llll llll hhhh hhhh */ {ANIW,"%a,%b", 3,19}, /* 05: 0000 0101 oooo oooo xxxx xxxx */ {illegal,0, 1, 4}, /* 06: */ {ANI,"A,%b", 2, 7}, /* 07: 0000 0111 xxxx xxxx */ {MOV,"A,EAH", 1, 4}, /* 08: 0000 1000 */ {MOV,"A,EAL", 1, 4}, /* 09: 0000 1001 */ {MOV,"A,B", 1, 4}, /* 0a: 0000 1010 */ {MOV,"A,C", 1, 4}, /* 0b: 0000 1011 */ {MOV,"A,D", 1, 4}, /* 0c: 0000 1100 */ {MOV,"A,E", 1, 4}, /* 0d: 0000 1101 */ {MOV,"A,H", 1, 4}, /* 0e: 0000 1110 */ {MOV,"A,L", 1, 4}, /* 0f: 0000 1111 */ {BLOCK,"D+", 1,13}, /* 10: 0001 0000 */ /* 7807 */ {BLOCK,"D-", 1,13}, /* 11: 0001 0001 */ /* 7807 */ {INX,"BC", 1, 7}, /* 12: 0001 0010 */ {DCX,"BC", 1, 7}, /* 13: 0001 0011 */ {LXI,"BC,%w", 3,10}, /* 14: 0001 0100 llll llll hhhh hhhh */ {ORIW,"%a,%b", 3,19}, /* 15: 0001 0101 oooo oooo xxxx xxxx */ {XRI,"A,%b", 2, 7}, /* 16: 0001 0110 xxxx xxxx */ {ORI,"A,%b", 2, 7}, /* 17: 0001 0111 xxxx xxxx */ {MOV,"EAH,A", 1, 4}, /* 18: 0001 1000 */ {MOV,"EAL,A", 1, 4}, /* 19: 0001 1001 */ {MOV,"B,A", 1, 4}, /* 1a: 0001 1010 */ {MOV,"C,A", 1, 4}, /* 1b: 0001 1011 */ {MOV,"D,A", 1, 4}, /* 1c: 0001 1100 */ {MOV,"E,A", 1, 4}, /* 1d: 0001 1101 */ {MOV,"H,A", 1, 4}, /* 1e: 0001 1110 */ {MOV,"L,A", 1, 4}, /* 1f: 0001 1111 */ {INRW,"%a", 2,16}, /* 20: 0010 0000 oooo oooo */ {JB,0, 1, 4}, /* 21: 0010 0001 */ {INX,"DE", 1, 7}, /* 22: 0010 0010 */ {DCX,"DE", 1, 7}, /* 23: 0010 0011 */ {LXI,"DE,%w", 3,10}, /* 24: 0010 0100 llll llll hhhh hhhh */ {GTIW,"%a,%b", 3,19}, /* 25: 0010 0101 oooo oooo xxxx xxxx */ {ADINC,"A,%b", 2, 7}, /* 26: 0010 0110 xxxx xxxx */ {GTI,"A,%b", 2, 7}, /* 27: 0010 0111 xxxx xxxx */ {illegal,0, 1, 4}, /* 28: 0010 1000 */ {LDAX,"(BC)", 1, 7}, /* 29: 0010 1001 */ {LDAX,"(DE)", 1, 7}, /* 2a: 0010 1010 */ {LDAX,"(HL)", 1, 7}, /* 2b: 0010 1011 */ {LDAX,"(DE+)", 1, 7}, /* 2c: 0010 1100 */ {LDAX,"(HL+)", 1, 7}, /* 2d: 0010 1101 */ {LDAX,"(DE-)", 1, 7}, /* 2e: 0010 1110 */ {LDAX,"(HL-)", 1, 7}, /* 2f: 0010 1111 */ {DCRW,"%a", 2,16}, /* 30: 0011 0000 oooo oooo */ {AND,"CY,%i", 2,10}, /* 31: 0011 0001 bbbb bbbb */ /* 7807 */ {INX,"HL", 1, 7}, /* 32: 0011 0010 */ {DCX,"HL", 1, 7}, /* 33: 0011 0011 */ {LXI,"HL,%w", 3,10}, /* 34: 0011 0100 llll llll hhhh hhhh */ {LTIW,"%a,%b", 3,19}, /* 35: 0011 0101 oooo oooo xxxx xxxx */ {SUINB,"A,%b", 2, 7}, /* 36: 0011 0110 xxxx xxxx */ {LTI,"A,%b", 2, 7}, /* 37: 0011 0111 xxxx xxxx */ {illegal,0, 1, 4}, /* 38: */ {STAX,"(BC)", 1, 7}, /* 39: 0011 1001 */ {STAX,"(DE)", 1, 7}, /* 3a: 0011 1010 */ {STAX,"(HL)", 1, 7}, /* 3b: 0011 1011 */ {STAX,"(DE+)", 1, 7}, /* 3c: 0011 1100 */ {STAX,"(HL+)", 1, 7}, /* 3d: 0011 1101 */ {STAX,"(DE-)", 1, 7}, /* 3e: 0011 1110 */ {STAX,"(HL-)", 1, 7}, /* 3f: 0011 1111 */ {CALL,"%w", 3,16}, /* 40: 0100 0000 llll llll hhhh hhhh */ {INR,"A", 1, 4}, /* 41: 0100 0001 */ {INR,"B", 1, 4}, /* 42: 0100 0010 */ {INR,"C", 1, 4}, /* 43: 0100 0011 */ {LXI,"EA,%w", 3,10}, /* 44: 0100 0100 llll llll hhhh hhhh */ {ONIW,"%a,%b", 3,19}, /* 45: 0100 0101 oooo oooo xxxx xxxx */ {ADI,"A,%b", 2, 7}, /* 46: 0100 0110 xxxx xxxx */ {ONI,"A,%b", 2, 7}, /* 47: 0100 0111 xxxx xxxx */ {0,dasm48_7807, 0, 0}, /* 48: prefix */ {MVIX,"BC,%b", 2,10}, /* 49: 0100 1001 xxxx xxxx */ {MVIX,"DE,%b", 2,10}, /* 4a: 0100 1010 xxxx xxxx */ {MVIX,"HL,%b", 2,10}, /* 4b: 0100 1011 xxxx xxxx */ {0,dasm4C_7807, 0, 0}, /* 4c: prefix */ {0,dasm4D_7807, 0, 0}, /* 4d: prefix */ {JRE,"%d", 2,10}, /* 4e: 0100 111d dddd dddd */ {JRE,"%d", 2,10}, /* 4f: 0100 111d dddd dddd */ {SKN,"%i", 2,10}, /* 50: 0101 0000 bbbb bbbb */ /* 7807 */ {DCR,"A", 1, 4}, /* 51: 0101 0001 */ {DCR,"B", 1, 4}, /* 52: 0101 0010 */ {DCR,"C", 1, 4}, /* 53: 0101 0011 */ {JMP,"%w", 3,10}, /* 54: 0101 0100 llll llll hhhh hhhh */ {OFFIW,"%a,%b", 3,19}, /* 55: 0101 0101 oooo oooo xxxx xxxx */ {ACI,"A,%b", 2, 7}, /* 56: 0101 0110 xxxx xxxx */ {OFFI,"A,%b", 2, 7}, /* 57: 0101 0111 xxxx xxxx */ {SETB,"%i", 2,13}, /* 58: 0101 1000 bbbb bbbb */ /* 7807 */ {NOT,"%i", 2,13}, /* 59: 0101 1001 bbbb bbbb */ /* 7807 */ {MOV,"%i,CY", 2,13}, /* 5a: 0101 1010 bbbb bbbb */ /* 7807 */ {CLR,"%i", 2,13}, /* 5b: 0101 1011 bbbb bbbb */ /* 7807 */ {OR,"CY,%i", 2,10}, /* 5c: 0101 1100 bbbb bbbb */ /* 7807 */ {SK,"%i", 2,10}, /* 5d: 0101 1101 bbbb bbbb */ /* 7807 */ {XOR,"CY,%i", 2,10}, /* 5e: 0101 1110 bbbb bbbb */ /* 7807 */ {MOV,"CY,%i", 2,10}, /* 5f: 0101 1111 bbbb bbbb */ /* 7807 */ {0,dasm60, 0, 0}, /* 60: prefix */ {DAA,0, 1, 4}, /* 61: 0110 0001 */ {RETI,0, 1,13}, /* 62: 0110 0010 */ {STAW,"%a", 2,10}, /* 63: 0110 0011 oooo oooo */ {0,dasm64_7807, 0, 0}, /* 64: prefix */ {NEIW,"%a,%b", 3,19}, /* 65: 0110 0101 oooo oooo xxxx xxxx */ {SUI,"A,%b", 2, 7}, /* 66: 0110 0110 xxxx xxxx */ {NEI,"A,%b", 2, 7}, /* 67: 0110 0111 xxxx xxxx */ {MVI,"V,%b", 2, 7}, /* 68: 0110 1000 xxxx xxxx */ {MVI,"A,%b", 2, 7}, /* 69: 0110 1001 xxxx xxxx */ {MVI,"B,%b", 2, 7}, /* 6a: 0110 1010 xxxx xxxx */ {MVI,"C,%b", 2, 7}, /* 6b: 0110 1011 xxxx xxxx */ {MVI,"D,%b", 2, 7}, /* 6c: 0110 1100 xxxx xxxx */ {MVI,"E,%b", 2, 7}, /* 6d: 0110 1101 xxxx xxxx */ {MVI,"H,%b", 2, 7}, /* 6e: 0110 1110 xxxx xxxx */ {MVI,"L,%b", 2, 7}, /* 6f: 0110 1111 xxxx xxxx */ {0,dasm70, 0, 0}, /* 70: prefix */ {MVIW,"%a,%b", 3,13}, /* 71: 0111 0001 oooo oooo xxxx xxxx */ {SOFTI,0, 1,16}, /* 72: 0111 0010 */ {illegal,0, 1, 0}, /* 73: */ {0,dasm74, 0, 0}, /* 74: prefix */ {EQIW,"%a,%b", 3,19}, /* 75: 0111 0101 oooo oooo xxxx xxxx */ {SBI,"A,%b", 2, 7}, /* 76: 0111 0110 xxxx xxxx */ {EQI,"A,%b", 2, 7}, /* 77: 0111 0111 xxxx xxxx */ {CALF,"%f", 2,13}, /* 78: 0111 1ddd dddd dddd */ {CALF,"%f", 2,13}, /* 79: 0111 1ddd dddd dddd */ {CALF,"%f", 2,13}, /* 7a: 0111 1ddd dddd dddd */ {CALF,"%f", 2,13}, /* 7b: 0111 1ddd dddd dddd */ {CALF,"%f", 2,13}, /* 7c: 0111 1ddd dddd dddd */ {CALF,"%f", 2,13}, /* 7d: 0111 1ddd dddd dddd */ {CALF,"%f", 2,13}, /* 7e: 0111 1ddd dddd dddd */ {CALF,"%f", 2,13}, /* 7f: 0111 1ddd dddd dddd */ {CALT,"%t", 1,16}, /* 80: 100t tttt */ {CALT,"%t", 1,16}, /* 81: 100t tttt */ {CALT,"%t", 1,16}, /* 82: 100t tttt */ {CALT,"%t", 1,16}, /* 83: 100t tttt */ {CALT,"%t", 1,16}, /* 84: 100t tttt */ {CALT,"%t", 1,16}, /* 85: 100t tttt */ {CALT,"%t", 1,16}, /* 86: 100t tttt */ {CALT,"%t", 1,16}, /* 87: 100t tttt */ {CALT,"%t", 1,16}, /* 88: 100t tttt */ {CALT,"%t", 1,16}, /* 89: 100t tttt */ {CALT,"%t", 1,16}, /* 8a: 100t tttt */ {CALT,"%t", 1,16}, /* 8b: 100t tttt */ {CALT,"%t", 1,16}, /* 8c: 100t tttt */ {CALT,"%t", 1,16}, /* 8d: 100t tttt */ {CALT,"%t", 1,16}, /* 8e: 100t tttt */ {CALT,"%t", 1,16}, /* 8f: 100t tttt */ {CALT,"%t", 1,16}, /* 90: 100t tttt */ {CALT,"%t", 1,16}, /* 91: 100t tttt */ {CALT,"%t", 1,16}, /* 92: 100t tttt */ {CALT,"%t", 1,16}, /* 93: 100t tttt */ {CALT,"%t", 1,16}, /* 94: 100t tttt */ {CALT,"%t", 1,16}, /* 95: 100t tttt */ {CALT,"%t", 1,16}, /* 96: 100t tttt */ {CALT,"%t", 1,16}, /* 97: 100t tttt */ {CALT,"%t", 1,16}, /* 98: 100t tttt */ {CALT,"%t", 1,16}, /* 99: 100t tttt */ {CALT,"%t", 1,16}, /* 9a: 100t tttt */ {CALT,"%t", 1,16}, /* 9b: 100t tttt */ {CALT,"%t", 1,16}, /* 9c: 100t tttt */ {CALT,"%t", 1,16}, /* 9d: 100t tttt */ {CALT,"%t", 1,16}, /* 9e: 100t tttt */ {CALT,"%t", 1,16}, /* 9f: 100t tttt */ {POP,"VA", 1,10}, /* a0: 1010 0000 */ {POP,"BC", 1,10}, /* a1: 1010 0001 */ {POP,"DE", 1,10}, /* a2: 1010 0010 */ {POP,"HL", 1,10}, /* a3: 1010 0011 */ {POP,"EA", 1,10}, /* a4: 1010 0100 */ {DMOV,"EA,BC", 1, 4}, /* a5: 1010 0101 */ {DMOV,"EA,DE", 1, 4}, /* a6: 1010 0110 */ {DMOV,"EA,HL", 1, 4}, /* a7: 1010 0111 */ {INX,"EA", 1, 7}, /* a8: 1010 1000 */ {DCX,"EA", 1, 7}, /* a9: 1010 1001 */ {EI,0, 1, 4}, /* aa: 1010 1010 */ {LDAX,"(DE+%b)", 2,13}, /* ab: 1010 1011 dddd dddd */ {LDAX,"(HL+A)", 1,13}, /* ac: 1010 1100 */ {LDAX,"(HL+B)", 1,13}, /* ad: 1010 1101 */ {LDAX,"(HL+EA)", 1,13}, /* ae: 1010 1110 */ {LDAX,"(HL+%b)", 2,13}, /* af: 1010 1111 dddd dddd */ {PUSH,"VA", 1,13}, /* b0: 1011 0000 */ {PUSH,"BC", 1,13}, /* b1: 1011 0001 */ {PUSH,"DE", 1,13}, /* b2: 1011 0010 */ {PUSH,"HL", 1,13}, /* b3: 1011 0011 */ {PUSH,"EA", 1,13}, /* b4: 1011 0100 */ {DMOV,"BC,EA", 1, 4}, /* b5: 1011 0101 */ {DMOV,"DE,EA", 1, 4}, /* b6: 1011 0110 */ {DMOV,"HL,EA", 1, 4}, /* b7: 1011 0111 */ {RET,0, 1,10}, /* b8: 1011 1000 */ {RETS,0, 1,10}, /* b9: 1011 1001 */ {DI,0, 1, 4}, /* ba: 1011 1010 */ {STAX,"(DE+%b)", 2,13}, /* bb: 1011 1011 dddd dddd */ {STAX,"(HL+A)", 1,13}, /* bc: 1011 1100 */ {STAX,"(HL+B)", 1,13}, /* bd: 1011 1101 */ {STAX,"(HL+EA)", 1,13}, /* be: 1011 1110 */ {STAX,"(HL+%b)", 2,13}, /* bf: 1011 1111 dddd dddd */ {JR,"%o", 1,10}, /* c0: 11oo oooo */ {JR,"%o", 1,10}, /* c1: 11oo oooo */ {JR,"%o", 1,10}, /* c2: 11oo oooo */ {JR,"%o", 1,10}, /* c3: 11oo oooo */ {JR,"%o", 1,10}, /* c4: 11oo oooo */ {JR,"%o", 1,10}, /* c5: 11oo oooo */ {JR,"%o", 1,10}, /* c6: 11oo oooo */ {JR,"%o", 1,10}, /* c7: 11oo oooo */ {JR,"%o", 1,10}, /* c8: 11oo oooo */ {JR,"%o", 1,10}, /* c9: 11oo oooo */ {JR,"%o", 1,10}, /* ca: 11oo oooo */ {JR,"%o", 1,10}, /* cb: 11oo oooo */ {JR,"%o", 1,10}, /* cc: 11oo oooo */ {JR,"%o", 1,10}, /* cd: 11oo oooo */ {JR,"%o", 1,10}, /* ce: 11oo oooo */ {JR,"%o", 1,10}, /* cf: 11oo oooo */ {JR,"%o", 1,10}, /* d0: 11oo oooo */ {JR,"%o", 1,10}, /* d1: 11oo oooo */ {JR,"%o", 1,10}, /* d2: 11oo oooo */ {JR,"%o", 1,10}, /* d3: 11oo oooo */ {JR,"%o", 1,10}, /* d4: 11oo oooo */ {JR,"%o", 1,10}, /* d5: 11oo oooo */ {JR,"%o", 1,10}, /* d6: 11oo oooo */ {JR,"%o", 1,10}, /* d7: 11oo oooo */ {JR,"%o", 1,10}, /* d8: 11oo oooo */ {JR,"%o", 1,10}, /* d9: 11oo oooo */ {JR,"%o", 1,10}, /* da: 11oo oooo */ {JR,"%o", 1,10}, /* db: 11oo oooo */ {JR,"%o", 1,10}, /* dc: 11oo oooo */ {JR,"%o", 1,10}, /* dd: 11oo oooo */ {JR,"%o", 1,10}, /* de: 11oo oooo */ {JR,"%o", 1,10}, /* df: 11oo oooo */ {JR,"%o", 1,10}, /* e0: 11oo oooo */ {JR,"%o", 1,10}, /* e1: 11oo oooo */ {JR,"%o", 1,10}, /* e2: 11oo oooo */ {JR,"%o", 1,10}, /* e3: 11oo oooo */ {JR,"%o", 1,10}, /* e4: 11oo oooo */ {JR,"%o", 1,10}, /* e5: 11oo oooo */ {JR,"%o", 1,10}, /* e6: 11oo oooo */ {JR,"%o", 1,10}, /* e7: 11oo oooo */ {JR,"%o", 1,10}, /* e8: 11oo oooo */ {JR,"%o", 1,10}, /* e9: 11oo oooo */ {JR,"%o", 1,10}, /* ea: 11oo oooo */ {JR,"%o", 1,10}, /* eb: 11oo oooo */ {JR,"%o", 1,10}, /* ec: 11oo oooo */ {JR,"%o", 1,10}, /* ed: 11oo oooo */ {JR,"%o", 1,10}, /* ee: 11oo oooo */ {JR,"%o", 1,10}, /* ef: 11oo oooo */ {JR,"%o", 1,10}, /* f0: 11oo oooo */ {JR,"%o", 1,10}, /* f1: 11oo oooo */ {JR,"%o", 1,10}, /* f2: 11oo oooo */ {JR,"%o", 1,10}, /* f3: 11oo oooo */ {JR,"%o", 1,10}, /* f4: 11oo oooo */ {JR,"%o", 1,10}, /* f5: 11oo oooo */ {JR,"%o", 1,10}, /* f6: 11oo oooo */ {JR,"%o", 1,10}, /* f7: 11oo oooo */ {JR,"%o", 1,10}, /* f8: 11oo oooo */ {JR,"%o", 1,10}, /* f9: 11oo oooo */ {JR,"%o", 1,10}, /* fa: 11oo oooo */ {JR,"%o", 1,10}, /* fb: 11oo oooo */ {JR,"%o", 1,10}, /* fc: 11oo oooo */ {JR,"%o", 1,10}, /* fd: 11oo oooo */ {JR,"%o", 1,10}, /* fe: 11oo oooo */ {JR,"%o", 1,10} /* ff: 11oo oooo */ }; /* register names for bit manipulation instructions */ const char *regname[32] = { "illegal", "illegal", "illegal", "illegal", "illegal", "illegal", "illegal", "illegal", "illegal", "illegal", "illegal", "illegal", "illegal", "illegal", "illegal", "illegal", "PA", "PB", "PC", "PD", "illegal", "PF", "MKH", "MKL", "illegal", "SMH", "illegal", "EOM", "illegal", "TMM", "PT", "illegal" }; unsigned Dasm( char *buffer, unsigned pc, struct dasm_s *dasmXX ) { UINT8 op = cpu_readop(pc++), op2, t; int offset; unsigned l, ea; const char *symbol; const char *a; t = dasmXX[op].token; a = dasmXX[op].args; l = dasmXX[op].oplen; /* 0 token means prefix opcode (use table from args) */ if (0 == t) { struct dasm_s *p_dasm = (struct dasm_s *)a; op2 = cpu_readop(pc++); t = p_dasm[op2].token; a = p_dasm[op2].args; l = p_dasm[op2].oplen; } buffer += sprintf(buffer, "%-8.8s", token[t]); while (a && *a) { if ('%' == *a) { a++; switch (*a) { case 'a': /* address V * 256 + offset */ op2 = cpu_readop_arg(pc++); ea = upd7810_get_reg(UPD7810_V) * 256 + op2; symbol = set_ea_info(0, ea, EA_UINT8, EA_MEM_RD); buffer += sprintf(buffer, "%s", symbol); break; case 'b': /* immediate byte */ ea = cpu_readop_arg(pc++); symbol = set_ea_info(1, ea, EA_UINT8, EA_VALUE); buffer += sprintf(buffer, "%s", symbol); break; case 'w': /* immediate word */ ea = cpu_readop_arg(pc++); ea += cpu_readop_arg(pc++) << 8; symbol = set_ea_info(1, ea, EA_UINT16, EA_VALUE); buffer += sprintf(buffer, "%s", symbol); break; case 'd': /* JRE address */ op2 = cpu_readop(pc++); offset = (op & 1)? -(256 - op2): + op2; symbol = set_ea_info(0, pc - 2, offset + 2, EA_REL_PC); buffer += sprintf(buffer, "%s", symbol); break; case 't': /* CALT address */ ea = 0x80 + 2 * (op & 0x1f); symbol = set_ea_info(0, ea, EA_DEFAULT, EA_ABS_PC); buffer += sprintf(buffer, "(%s)", symbol); break; case 'f': /* CALF address */ op2 = cpu_readop(pc++); ea = 0x800 + 0x100 * (op & 0x07) + op2; symbol = set_ea_info(0, ea, EA_DEFAULT, EA_ABS_PC); buffer += sprintf(buffer, "%s", symbol); break; case 'o': /* JR offset */ op2 = cpu_readop(pc++); offset = (INT8)(op << 2) >> 2; symbol = set_ea_info(0, pc - 2, offset + 1, EA_REL_PC); buffer += sprintf(buffer, "%s", symbol); break; case 'i': /* bit manipulation */ op2 = cpu_readop(pc++); buffer += sprintf(buffer, "%s,%d", regname[op2 & 0x1f], op2 >> 5); break; default: *buffer++ = *a; } } else *buffer++ = *a; a++; } *buffer = '\0'; return l; } unsigned Dasm7810( char *buffer, unsigned pc ) { return Dasm( buffer, pc, dasmXX_7810 ); } unsigned Dasm7807( char *buffer, unsigned pc ) { return Dasm( buffer, pc, dasmXX_7807 ); } #endif /* MAME_DEBUG */ ======================= File: src/sound/tiasound.c ======================= /*****************************************************************************/ /* */ /* Module: TIA Chip Sound Simulator */ /* Purpose: To emulate the sound generation hardware of the Atari TIA chip. */ /* Author: <NAME> */ /* */ /* Revision History: */ /* 10-Sep-96 - V1.0 - Initial Release */ /* 14-Jan-97 - V1.1 - Cleaned up sound output by eliminating counter */ /* reset. */ /* 30-Oct-98 - Modified for use in MESS by Dan Boris */ /* 28-Jul-01 - Added support for sample rates > TIA clock rate, */ /* through oversampling */ /* */ /* */ /* */ /*****************************************************************************/ /* */ /* License Information and Copyright Notice */ /* ======================================== */ /* */ /* TiaSound is Copyright(c) 1996 by <NAME> */ /* */ /* This library is free software; you can redistribute it and/or modify it */ /* under the terms of version 2 of the GNU Library General Public License */ /* as published by the Free Software Foundation. */ /* */ /* This library is distributed in the hope that it will be useful, but */ /* WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library */ /* General Public License for more details. */ /* To obtain a copy of the GNU Library General Public License, write to the */ /* Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* */ /* Any permitted reproduction of these routines, in whole or in part, must */ /* bear this legend. */ /* */ /*****************************************************************************/ #include "driver.h" #include "tiaintf.h" #include "tiasound.h" /* number of bits to shift left AUDV0/AUDV1 registers for 16 bit volume */ #define AUDV_SHIFT 10 /* CONSTANT DEFINITIONS */ /* definitions for AUDCx (15, 16) */ #define SET_TO_1 0x00 /* 0000 */ #define POLY4 0x01 /* 0001 */ #define DIV31_POLY4 0x02 /* 0010 */ #define POLY5_POLY4 0x03 /* 0011 */ #define PURE 0x04 /* 0100 */ #define PURE2 0x05 /* 0101 */ #define DIV31_PURE 0x06 /* 0110 */ #define POLY5_2 0x07 /* 0111 */ #define POLY9 0x08 /* 1000 */ #define POLY5 0x09 /* 1001 */ #define DIV31_POLY5 0x0a /* 1010 */ #define POLY5_POLY5 0x0b /* 1011 */ #define DIV3_PURE 0x0c /* 1100 */ #define DIV3_PURE2 0x0d /* 1101 */ #define DIV93_PURE 0x0e /* 1110 */ #define DIV3_POLY5 0x0f /* 1111 */ #ifndef POLY9 #define POLY9 0x80 /* selects POLY9 or POLY17 */ #endif #define DIV3_MASK 0x0c #define AUDC0 0x15 #define AUDC1 0x16 #define AUDF0 0x17 #define AUDF1 0x18 #define AUDV0 0x19 #define AUDV1 0x1a /* the size (in entries) of the 4 polynomial tables */ #define POLY4_SIZE 0x000f #define POLY5_SIZE 0x001f #define POLY9_SIZE 0x01ff /* channel definitions */ #define CHAN1 0 #define CHAN2 1 #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE #define TRUE 1 #endif /* LOCAL GLOBAL VARIABLE DEFINITIONS */ /* structures to hold the 6 tia sound control bytes */ static UINT8 AUDC[2]; /* AUDCx (15, 16) */ static UINT8 AUDF[2]; /* AUDFx (17, 18) */ static INT16 AUDV[2]; /* AUDVx (19, 1A) */ static INT16 Outvol[2]; /* last output volume for each channel */ static int tia_gain; /* initialized in tia_sound_init() */ /* Initialze the bit patterns for the polynomials. */ /* The 4bit and 5bit patterns are the identical ones used in the tia chip. */ /* Though the patterns could be packed with 8 bits per byte, using only a */ /* single bit per byte keeps the math simple, which is important for */ /* efficient processing. */ /* HJB: poly bits are initialized at runtime */ static UINT8 Bit4[POLY4_SIZE]; static UINT8 Bit5[POLY5_SIZE]; static UINT8 Bit9[POLY9_SIZE]; /* I've treated the 'Div by 31' counter as another polynomial because of */ /* the way it operates. It does not have a 50% duty cycle, but instead */ /* has a 13:18 ratio (of course, 13+18 = 31). This could also be */ /* implemented by using counters. */ static UINT8 Div31[POLY5_SIZE] = {0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static UINT8 P4[2]; /* Position pointer for the 4-bit POLY array */ static UINT8 P5[2]; /* Position pointer for the 5-bit POLY array */ static UINT16 P9[2]; /* Position pointer for the 9-bit POLY array */ static UINT8 Div_n_cnt[2]; /* Divide by n counter. one for each channel */ static UINT8 Div_n_max[2]; /* Divide by n maximum, one for each channel */ /* In my routines, I treat the sample output as another divide by N counter. */ /* For better accuracy, the Samp_n_cnt has a fixed binary decimal point */ /* which has 8 binary digits to the right of the decimal point. */ static UINT16 Samp_n_max; /* Sample max, multiplied by 256 */ static UINT16 Samp_n_cnt; /* Sample cnt. */ static int oversampling; /* Added oversampling for sample_rate > clock_rate */ /*****************************************************************************/ /* Module: tia_sound_w() */ /* Purpose: To process the latest control values stored in the AUDF, AUDC, */ /* and AUDV registers. It pre-calculates as much information as */ /* possible for better performance. This routine has not been */ /* optimized. */ /* */ /* Author: <NAME> */ /* Date: January 14, 1997 */ /* */ /* Inputs: addr - the address of the parameter to be changed */ /* val - the new value to be placed in the specified address */ /* */ /* Outputs: Adjusts local globals - no return value */ /* */ /*****************************************************************************/ WRITE_HANDLER( tia_sound_w ) { UINT16 new_val = 0; UINT8 chan; tia_sh_update(); /* determine which address was changed */ switch (offset) { case AUDC0: AUDC[0] = data & 0x0f; chan = 0; break; case AUDC1: AUDC[1] = data & 0x0f; chan = 1; break; case AUDF0: AUDF[0] = data & 0x1f; chan = 0; break; case AUDF1: AUDF[1] = data & 0x1f; chan = 1; break; case AUDV0: AUDV[0] = ((data & 0x0f) << AUDV_SHIFT) * tia_gain / TIA_DEFAULT_GAIN; chan = 0; break; case AUDV1: AUDV[1] = ((data & 0x0f) << AUDV_SHIFT) * tia_gain / TIA_DEFAULT_GAIN; chan = 1; break; default: chan = 255; break; } /* if the output value changed */ if (chan!= 255) { /* an AUDC value of 0 is a special case */ if (AUDC[chan] == SET_TO_1) { /* indicate the clock is zero so no processing will occur */ new_val = 0; /* and set the output to the selected volume */ Outvol[chan] = AUDV[chan]; } else { /* otherwise calculate the 'divide by N' value */ new_val = AUDF[chan] + 1; /* if bits 2 & 3 are set, then multiply the 'div by n' count by 3 */ if ((AUDC[chan] & DIV3_MASK) == DIV3_MASK) { new_val *= 3; } } /* only reset those channels that have changed */ if (new_val!= Div_n_max[chan]) { /* reset the divide by n counters */ Div_n_max[chan] = new_val; /* if the channel is now volume only or was volume only */ if ((Div_n_cnt[chan] == 0) || (new_val == 0)) { /* reset the counter (otherwise let it complete the previous) */ Div_n_cnt[chan] = new_val; } } } } /*****************************************************************************/ /* Module: tia_process() */ /* Purpose: To fill the output buffer with the sound output based on the */ /* tia chip parameters. This routine has been optimized. */ /* */ /* Author: <NAME> */ /* Date: September 10, 1996 */ /* */ /* Inputs: *buffer - pointer to the buffer where the audio output will */ /* be placed */ /* n - size of the playback buffer */ /* */ /* Outputs: the buffer will be filled with n bytes of audio - no return val */ /* */ /*****************************************************************************/ void tia_process(int param, INT16 *buffer, int length) { UINT8 audc0, audc1; UINT8 div_n_cnt0, div_n_cnt1; UINT8 p5_0, p5_1; INT16 audv0, audv1, outvol_0, outvol_1; audc0 = AUDC[0]; audc1 = AUDC[1]; audv0 = AUDV[0]; audv1 = AUDV[1]; /* make temporary local copy */ p5_0 = P5[0]; p5_1 = P5[1]; outvol_0 = Outvol[0]; outvol_1 = Outvol[1]; div_n_cnt0 = Div_n_cnt[0]; div_n_cnt1 = Div_n_cnt[1]; /* loop until the buffer is filled */ while (length > 0) { /* Process channel 0 */ if (div_n_cnt0 > 1) { div_n_cnt0--; } else if (div_n_cnt0 == 1) { div_n_cnt0 = Div_n_max[0]; /* the P5 counter has multiple uses, so we inc it here */ p5_0++; if (p5_0 == POLY5_SIZE) p5_0 = 0; /* check clock modifier for clock tick */ if ((audc0 & 0x02) == 0 || ((audc0 & 0x01) == 0 && Div31[p5_0]) || ((audc0 & 0x01) == 1 && Bit5[p5_0])) { if (audc0 & 0x04) /* pure modified clock selected */ { if (outvol_0) /* if the output was set */ outvol_0 = 0; /* turn it off */ else outvol_0 = audv0; /* else turn it on */ } else if (audc0 & 0x08) /* check for p5/p9 */ { if (audc0 == POLY9) /* check for poly9 */ { /* inc the poly9 counter */ P9[0]++; if (P9[0] == POLY9_SIZE) P9[0] = 0; if (Bit9[P9[0]]) outvol_0 = audv0; else outvol_0 = 0; } else /* must be poly5 */ { if (Bit5[p5_0]) outvol_0 = audv0; else outvol_0 = 0; } } else /* poly4 is the only remaining option */ { /* inc the poly4 counter */ P4[0]++; if (P4[0] == POLY4_SIZE) P4[0] = 0; if (Bit4[P4[0]]) outvol_0 = audv0; else outvol_0 = 0; } } } /* Process channel 1 */ if (div_n_cnt1 > 1) { div_n_cnt1--; } else if (div_n_cnt1 == 1) { div_n_cnt1 = Div_n_max[1]; /* the P5 counter has multiple uses, so we inc it here */ p5_1++; if (p5_1 == POLY5_SIZE) p5_1 = 0; /* check clock modifier for clock tick */ if ((audc1 & 0x02) == 0 || ((audc1 & 0x01) == 0 && Div31[p5_1]) || ((audc1 & 0x01) == 1 && Bit5[p5_1])) { if (audc1 & 0x04) /* pure modified clock selected */ { if (outvol_1) /* if the output was set */ outvol_1 = 0; /* turn it off */ else outvol_1 = audv1; /* else turn it on */ } else if (audc1 & 0x08) /* check for p5/p9 */ { if (audc1 == POLY9) /* check for poly9 */ { /* inc the poly9 counter */ P9[1]++; if (P9[1] == POLY9_SIZE) P9[1] = 0; if (Bit9[P9[1]]) outvol_1 = audv1; else outvol_1 = 0; } else /* must be poly5 */ { if (Bit5[p5_1]) outvol_1 = audv1; else outvol_1 = 0; } } else /* poly4 is the only remaining option */ { /* inc the poly4 counter */ P4[1]++; if (P4[1] == POLY4_SIZE) P4[1] = 0; if (Bit4[P4[1]]) outvol_1 = audv1; else outvol_1 = 0; } } } if (!oversampling) { /* decrement the sample counter - value is 256 since the lower * byte contains the fractional part */ Samp_n_cnt -= 256; /* if the count down has reached zero */ if (Samp_n_cnt < 256) { /* adjust the sample counter */ Samp_n_cnt += Samp_n_max; /* calculate the latest output value and place in buffer */ *buffer++ = outvol_0 + outvol_1; /* and indicate one less byte to process */ length--; } } else { do { /* decrement the sample counter - value is 256 since the lower * byte contains the fractional part */ Samp_n_cnt -= 256; /* calculate the latest output value and place in buffer */ *buffer++ = outvol_0 + outvol_1; length--; } while ((Samp_n_cnt >= 256) && (length > 0)); /* adjust the sample counter if necessary */ if (Samp_n_cnt < 256) Samp_n_cnt += Samp_n_max; } } /* save for next round */ P5[0] = p5_0; P5[1] = p5_1; Outvol[0] = outvol_0; Outvol[1] = outvol_1; Div_n_cnt[0] = div_n_cnt0; Div_n_cnt[1] = div_n_cnt1; } static void poly_init(UINT8 *poly, int size, int left, int right, int add) { int mask = (1 << size) - 1; int i, x = 0; for (i = 0; i < mask; i++) { *poly++ = x & 1; /* calculate next bit */ x = ((x << left) + (x >> right) + add) & mask; } } /*****************************************************************************/ /* Module: tia_sh_start() */ /* Purpose: to handle the power-up initialization functions */ /* these functions should only be executed on a cold-restart */ /* */ /* Author: <NAME> */ /* Date: September 10, 1996 */ /* */ /* Inputs: struct MachineSound *msound */ /* is a pointer to the struct TIAInterface parameters */ /* */ /* Outputs: returns zero on success */ /* */ /*****************************************************************************/ void tia_sound_init(int clock, int sample_rate, int gain) { int chan; /* set the gain factor (normally use TIA_DEFAULT_GAIN) */ tia_gain = gain; /* fill the polynomials */ poly_init(Bit4, 4, 3, 1, 0x00004); poly_init(Bit5, 5, 3, 2, 0x00008); poly_init(Bit9, 9, 2, 7, 0x00080); /* calculate the sample 'divide by N' value based on the playback freq. */ Samp_n_max = ((UINT16)(UINT32)clock << 8) / sample_rate; Samp_n_cnt = Samp_n_max; /* initialize all bits of the sample counter */ if (Samp_n_max < 256) /* we need to use oversampling for sample_rate > clock_rate */ /* at the Machine->sample_rate for now */ { Samp_n_max = ((UINT16)(UINT32)sample_rate << 8) / clock; Samp_n_cnt = Samp_n_max; oversampling = 1; } /* initialize the local globals */ for (chan = CHAN1; chan <= CHAN2; chan++) { Outvol[chan] = 0; Div_n_cnt[chan] = 0; Div_n_max[chan] = 0; AUDC[chan] = 0; AUDF[chan] = 0; AUDV[chan] = 0; P4[chan] = 0; P5[chan] = 0; P9[chan] = 0; } } ======================= File: src/cpu/z180/z180.c ======================= <filename>src/cpu/z180/z180.c<gh_stars>0 /***************************************************************************** * * z180.c * Portable Z180 emulator V0.2 * * Copyright (C) 2000 <NAME>, all rights reserved. * * - This source code is released as freeware for non-commercial purposes. * - You are free to use and redistribute this code in modified or * unmodified form, provided you list me in the credits. * - If you modify this source code, you must add a notice to each modified * source file that it has been changed. If you're a nice person, you * will clearly mark each change too. :) * - If you wish to use this for commercial purposes, please contact me at * <EMAIL> * - The author of this copywritten work reserves the right to change the * terms of its usage and license at any time, including retroactively * - This entire notice must remain in the source code. * *****************************************************************************/ #include "driver.h" #include "cpuintrf.h" #include "state.h" #include "mamedbg.h" #include "z180.h" #include "log.h" /* execute main opcodes inside a big switch statement */ /* execute main opcodes inside a big switch statement */ #ifndef BIG_SWITCH #define BIG_SWITCH 1 #endif /* use big flag arrays (4*64K) for ADD/ADC/SUB/SBC/CP results */ #define BIG_FLAGS_ARRAY 1 /* Set to 1 for a more exact (but somewhat slower) Z180 emulation */ #define Z180_EXACT 1 /* on JP and JR opcodes check for tight loops */ #define BUSY_LOOP_HACKS 1 /* check for delay loops counting down BC */ #define TIME_LOOP_HACKS 1 static UINT8 z180_reg_layout[] = { Z180_PC, Z180_SP, Z180_AF, Z180_BC, Z180_DE, Z180_HL, -1, Z180_IX, Z180_IY, Z180_AF2, Z180_BC2, Z180_DE2, Z180_HL2, -1, Z180_R, Z180_I, Z180_IL, Z180_IM, Z180_IFF1, Z180_IFF2, -1, Z180_INT0_STATE,Z180_INT1_STATE,Z180_INT2_STATE,Z180_DC0, Z180_DC1,Z180_DC2,Z180_DC3, -1, Z180_CCR,Z180_ITC,Z180_CBR, Z180_BBR, Z180_CBAR, Z180_OMCR, 0 }; static UINT8 z180_win_layout[] = { 27, 0,53, 6, /* register window (top rows) */ 0, 0,26,22, /* disassembler window (left colums) */ 27, 7,53, 6, /* memory #1 window (right, upper middle) */ 27,14,53, 8, /* memory #2 window (right, lower middle) */ 0,23,80, 1, /* command line window (bottom rows) */ }; /****************************************************************************/ /* The Z180 registers. HALT is set to 1 when the CPU is halted, the refresh */ /* register is calculated as follows: refresh=(Regs.R&127)|(Regs.R2&128) */ /****************************************************************************/ typedef struct { /* 00 */ PAIR PREPC,PC,SP,AF,BC,DE,HL,IX,IY; /* 24 */ PAIR AF2,BC2,DE2,HL2; /* 34 */ UINT8 R,R2,IFF1,IFF2,HALT,IM,I; /* 3B */ UINT8 tmdr_latch; /* flag latched TMDR0H, TMDR1H values */ /* 3C */ UINT32 iol; /* I/O line status bits */ /* 40 */ UINT8 io[64]; /* 64 internal 8 bit registers */ /* 80 */ offs_t mmu[16]; /* MMU address translation */ /* c0 */ UINT8 tmdr[2]; /* latched TMDR0H and TMDR1H values */ /* c2 */ UINT8 irq_max; /* number of daisy chain devices */ /* c3 */ INT8 request_irq; /* daisy chain next request device */ /* c4 */ INT8 service_irq; /* daisy chain next reti handling device */ /* c5 */ UINT8 nmi_state; /* nmi line state */ /* c6 */ UINT8 irq_state[10]; /* irq line states (INT0,INT1,INT2) */ /* d0 */ UINT8 int_state[Z80_MAXDAISY]; /* d4 */ Z80_DaisyChain irq[Z80_MAXDAISY]; /* e4 */ int (*irq_callback)(int irqline); /* e8 */ int extra_cycles; /* extra cycles for interrupts */ } Z180_Regs; #define CF 0x01 #define NF 0x02 #define PF 0x04 #define VF PF #define XF 0x08 #define HF 0x10 #define YF 0x20 #define ZF 0x40 #define SF 0x80 /* I/O line status flags */ #define Z180_CKA0 0x00000001 /* I/O asynchronous clock 0 (active high) or DREQ0 (mux) */ #define Z180_CKA1 0x00000002 /* I/O asynchronous clock 1 (active high) or TEND1 (mux) */ #define Z180_CKS 0x00000004 /* I/O serial clock (active high) */ #define Z180_CTS0 0x00000100 /* I clear to send 0 (active low) */ #define Z180_CTS1 0x00000200 /* I clear to send 1 (active low) or RXS (mux) */ #define Z180_DCD0 0x00000400 /* I data carrier detect (active low) */ #define Z180_DREQ0 0x00000800 /* I data request DMA ch 0 (active low) or CKA0 (mux) */ #define Z180_DREQ1 0x00001000 /* I data request DMA ch 1 (active low) */ #define Z180_RXA0 0x00002000 /* I asynchronous receive data 0 (active high) */ #define Z180_RXA1 0x00004000 /* I asynchronous receive data 1 (active high) */ #define Z180_RXS 0x00008000 /* I clocked serial receive data (active high) or CTS1 (mux) */ #define Z180_RTS0 0x00010000 /* O request to send (active low) */ #define Z180_TEND0 0x00020000 /* O transfer end 0 (active low) or CKA1 (mux) */ #define Z180_TEND1 0x00040000 /* O transfer end 1 (active low) */ #define Z180_A18_TOUT 0x00080000 /* O transfer out (PRT channel, active low) or A18 (mux) */ #define Z180_TXA0 0x00100000 /* O asynchronous transmit data 0 (active high) */ #define Z180_TXA1 0x00200000 /* O asynchronous transmit data 1 (active high) */ #define Z180_TXS 0x00400000 /* O clocked serial transmit data (active high) */ #define _PPC Z180.PREPC.d /* previous program counter */ #define _PCD Z180.PC.d #define _PC Z180.PC.w.l #define _SPD Z180.SP.d #define _SP Z180.SP.w.l #define _AFD Z180.AF.d #define _AF Z180.AF.w.l #define _A Z180.AF.b.h #define _F Z180.AF.b.l #define _BCD Z180.BC.d #define _BC Z180.BC.w.l #define _B Z180.BC.b.h #define _C Z180.BC.b.l #define _DED Z180.DE.d #define _DE Z180.DE.w.l #define _D Z180.DE.b.h #define _E Z180.DE.b.l #define _HLD Z180.HL.d #define _HL Z180.HL.w.l #define _H Z180.HL.b.h #define _L Z180.HL.b.l #define _IXD Z180.IX.d #define _IX Z180.IX.w.l #define _HX Z180.IX.b.h #define _LX Z180.IX.b.l #define _IYD Z180.IY.d #define _IY Z180.IY.w.l #define _HY Z180.IY.b.h #define _LY Z180.IY.b.l #define _I Z180.I #define _R Z180.R #define _R2 Z180.R2 #define _IM Z180.IM #define _IFF1 Z180.IFF1 #define _IFF2 Z180.IFF2 #define _HALT Z180.HALT #define IO(n) Z180.io[(n)-Z180_CNTLA0] #define IO_CNTLA0 IO(Z180_CNTLA0) #define IO_CNTLA1 IO(Z180_CNTLA1) #define IO_CNTLB0 IO(Z180_CNTLB0) #define IO_CNTLB1 IO(Z180_CNTLB1) #define IO_STAT0 IO(Z180_STAT0) #define IO_STAT1 IO(Z180_STAT1) #define IO_TDR0 IO(Z180_TDR0) #define IO_TDR1 IO(Z180_TDR1) #define IO_RDR0 IO(Z180_RDR0) #define IO_RDR1 IO(Z180_RDR1) #define IO_CNTR IO(Z180_CNTR) #define IO_TRDR IO(Z180_TRDR) #define IO_TMDR0L IO(Z180_TMDR0L) #define IO_TMDR0H IO(Z180_TMDR0H) #define IO_RLDR0L IO(Z180_RLDR0L) #define IO_RLDR0H IO(Z180_RLDR0H) #define IO_TCR IO(Z180_TCR) #define IO_IO11 IO(Z180_IO11) #define IO_ASEXT0 IO(Z180_ASEXT0) #define IO_ASEXT1 IO(Z180_ASEXT1) #define IO_TMDR1L IO(Z180_TMDR1L) #define IO_TMDR1H IO(Z180_TMDR1H) #define IO_RLDR1L IO(Z180_RLDR1L) #define IO_RLDR1H IO(Z180_RLDR1H) #define IO_FRC IO(Z180_FRC) #define IO_IO19 IO(Z180_IO19) #define IO_ASTC0L IO(Z180_ASTC0L) #define IO_ASTC0H IO(Z180_ASTC0H) #define IO_ASTC1L IO(Z180_ASTC1L) #define IO_ASTC1H IO(Z180_ASTC1H) #define IO_CMR IO(Z180_CMR) #define IO_CCR IO(Z180_CCR) #define IO_SAR0L IO(Z180_SAR0L) #define IO_SAR0H IO(Z180_SAR0H) #define IO_SAR0B IO(Z180_SAR0B) #define IO_DAR0L IO(Z180_DAR0L) #define IO_DAR0H IO(Z180_DAR0H) #define IO_DAR0B IO(Z180_DAR0B) #define IO_BCR0L IO(Z180_BCR0L) #define IO_BCR0H IO(Z180_BCR0H) #define IO_MAR1L IO(Z180_MAR1L) #define IO_MAR1H IO(Z180_MAR1H) #define IO_MAR1B IO(Z180_MAR1B) #define IO_IAR1L IO(Z180_IAR1L) #define IO_IAR1H IO(Z180_IAR1H) #define IO_IAR1B IO(Z180_IAR1B) #define IO_BCR1L IO(Z180_BCR1L) #define IO_BCR1H IO(Z180_BCR1H) #define IO_DSTAT IO(Z180_DSTAT) #define IO_DMODE IO(Z180_DMODE) #define IO_DCNTL IO(Z180_DCNTL) #define IO_IL IO(Z180_IL) #define IO_ITC IO(Z180_ITC) #define IO_IO35 IO(Z180_IO35) #define IO_RCR IO(Z180_RCR) #define IO_IO37 IO(Z180_IO37) #define IO_CBR IO(Z180_CBR) #define IO_BBR IO(Z180_BBR) #define IO_CBAR IO(Z180_CBAR) #define IO_IO3B IO(Z180_IO3B) #define IO_IO3C IO(Z180_IO3C) #define IO_IO3D IO(Z180_IO3D) #define IO_OMCR IO(Z180_OMCR) #define IO_IOCR IO(Z180_IOCR) /* 00 ASCI control register A ch 0 */ #define Z180_CNTLA0_MPE 0x80 #define Z180_CNTLA0_RE 0x40 #define Z180_CNTLA0_TE 0x20 #define Z180_CNTLA0_RTS0 0x10 #define Z180_CNTLA0_MPBR_EFR 0x08 #define Z180_CNTLA0_MODE_DATA 0x04 #define Z180_CNTLA0_MODE_PARITY 0x02 #define Z180_CNTLA0_MODE_STOPB 0x01 #define Z180_CNTLA0_RESET 0x10 #define Z180_CNTLA0_RMASK 0xff #define Z180_CNTLA0_WMASK 0xff /* 01 ASCI control register A ch 1 */ #define Z180_CNTLA1_MPE 0x80 #define Z180_CNTLA1_RE 0x40 #define Z180_CNTLA1_TE 0x20 #define Z180_CNTLA1_CKA1D 0x10 #define Z180_CNTLA1_MPBR_EFR 0x08 #define Z180_CNTLA1_MODE 0x07 #define Z180_CNTLA1_RESET 0x10 #define Z180_CNTLA1_RMASK 0xff #define Z180_CNTLA1_WMASK 0xff /* 02 ASCI control register B ch 0 */ #define Z180_CNTLB0_MPBT 0x80 #define Z180_CNTLB0_MP 0x40 #define Z180_CNTLB0_CTS_PS 0x20 #define Z180_CNTLB0_PEO 0x10 #define Z180_CNTLB0_DR 0x08 #define Z180_CNTLB0_SS 0x07 #define Z180_CNTLB0_RESET 0x07 #define Z180_CNTLB0_RMASK 0xff #define Z180_CNTLB0_WMASK 0xff /* 03 ASCI control register B ch 1 */ #define Z180_CNTLB1_MPBT 0x80 #define Z180_CNTLB1_MP 0x40 #define Z180_CNTLB1_CTS_PS 0x20 #define Z180_CNTLB1_PEO 0x10 #define Z180_CNTLB1_DR 0x08 #define Z180_CNTLB1_SS 0x07 #define Z180_CNTLB1_RESET 0x07 #define Z180_CNTLB1_RMASK 0xff #define Z180_CNTLB1_WMASK 0xff /* 04 ASCI status register 0 */ #define Z180_STAT0_RDRF 0x80 #define Z180_STAT0_OVRN 0x40 #define Z180_STAT0_PE 0x20 #define Z180_STAT0_FE 0x10 #define Z180_STAT0_RIE 0x08 #define Z180_STAT0_DCD0 0x04 #define Z180_STAT0_TDRE 0x02 #define Z180_STAT0_TIE 0x01 #define Z180_STAT0_RESET 0x00 #define Z180_STAT0_RMASK 0xff #define Z180_STAT0_WMASK 0x09 /* 05 ASCI status register 1 */ #define Z180_STAT1_RDRF 0x80 #define Z180_STAT1_OVRN 0x40 #define Z180_STAT1_PE 0x20 #define Z180_STAT1_FE 0x10 #define Z180_STAT1_RIE 0x08 #define Z180_STAT1_CTS1E 0x04 #define Z180_STAT1_TDRE 0x02 #define Z180_STAT1_TIE 0x01 #define Z180_STAT1_RESET 0x00 #define Z180_STAT1_RMASK 0xff #define Z180_STAT1_WMASK 0x0d /* 06 ASCI transmit data register 0 */ #define Z180_TDR0_TDR 0xff #define Z180_TDR0_RESET 0x00 #define Z180_TDR0_RMASK 0xff #define Z180_TDR0_WMASK 0xff /* 07 ASCI transmit data register 1 */ #define Z180_TDR1_TDR 0xff #define Z180_TDR1_RESET 0x00 #define Z180_TDR1_RMASK 0xff #define Z180_TDR1_WMASK 0xff /* 08 ASCI receive register 0 */ #define Z180_RDR0_RDR 0xff #define Z180_RDR0_RESET 0x00 #define Z180_RDR0_RMASK 0xff #define Z180_RDR0_WMASK 0xff /* 09 ASCI receive register 1 */ #define Z180_RDR1_RDR 0xff #define Z180_RDR1_RESET 0x00 #define Z180_RDR1_RMASK 0xff #define Z180_RDR1_WMASK 0xff /* 0a CSI/O control/status register */ #define Z180_CNTR_EF 0x80 #define Z180_CNTR_EIE 0x40 #define Z180_CNTR_RE 0x20 #define Z180_CNTR_TE 0x10 #define Z180_CNTR_SS 0x07 #define Z180_CNTR_RESET 0x07 #define Z180_CNTR_RMASK 0xff #define Z180_CNTR_WMASK 0x7f /* 0b CSI/O transmit/receive register */ #define Z180_TRDR_RESET 0x00 #define Z180_TRDR_RMASK 0xff #define Z180_TRDR_WMASK 0xff /* 0c TIMER data register ch 0 L */ #define Z180_TMDR0L_RESET 0x00 #define Z180_TMDR0L_RMASK 0xff #define Z180_TMDR0L_WMASK 0xff /* 0d TIMER data register ch 0 H */ #define Z180_TMDR0H_RESET 0x00 #define Z180_TMDR0H_RMASK 0xff #define Z180_TMDR0H_WMASK 0xff /* 0e TIMER reload register ch 0 L */ #define Z180_RLDR0L_RESET 0xff #define Z180_RLDR0L_RMASK 0xff #define Z180_RLDR0L_WMASK 0xff /* 0f TIMER reload register ch 0 H */ #define Z180_RLDR0H_RESET 0xff #define Z180_RLDR0H_RMASK 0xff #define Z180_RLDR0H_WMASK 0xff /* 10 TIMER control register */ #define Z180_TCR_TIF1 0x80 #define Z180_TCR_TIF0 0x40 #define Z180_TCR_TIE1 0x20 #define Z180_TCR_TIE0 0x10 #define Z180_TCR_TOC1 0x08 #define Z180_TCR_TOC0 0x04 #define Z180_TCR_TDE1 0x02 #define Z180_TCR_TDE0 0x01 #define Z180_TCR_RESET 0x00 #define Z180_TCR_RMASK 0xff #define Z180_TCR_WMASK 0xff /* 11 reserved */ #define Z180_IO11_RESET 0x00 #define Z180_IO11_RMASK 0xff #define Z180_IO11_WMASK 0xff /* 12 (Z8S180/Z8L180) ASCI extension control register 0 */ #define Z180_ASEXT0_RDRF 0x80 #define Z180_ASEXT0_DCD0 0x40 #define Z180_ASEXT0_CTS0 0x20 #define Z180_ASEXT0_X1_BIT_CLK0 0x10 #define Z180_ASEXT0_BRG0_MODE 0x08 #define Z180_ASEXT0_BRK_EN 0x04 #define Z180_ASEXT0_BRK_DET 0x02 #define Z180_ASEXT0_BRK_SEND 0x01 #define Z180_ASEXT0_RESET 0x00 #define Z180_ASEXT0_RMASK 0xff #define Z180_ASEXT0_WMASK 0xfd /* 13 (Z8S180/Z8L180) ASCI extension control register 0 */ #define Z180_ASEXT1_RDRF 0x80 #define Z180_ASEXT1_X1_BIT_CLK1 0x10 #define Z180_ASEXT1_BRG1_MODE 0x08 #define Z180_ASEXT1_BRK_EN 0x04 #define Z180_ASEXT1_BRK_DET 0x02 #define Z180_ASEXT1_BRK_SEND 0x01 #define Z180_ASEXT1_RESET 0x00 #define Z180_ASEXT1_RMASK 0xff #define Z180_ASEXT1_WMASK 0xfd /* 14 TIMER data register ch 1 L */ #define Z180_TMDR1L_RESET 0x00 #define Z180_TMDR1L_RMASK 0xff #define Z180_TMDR1L_WMASK 0xff /* 15 TIMER data register ch 1 H */ #define Z180_TMDR1H_RESET 0x00 #define Z180_TMDR1H_RMASK 0xff #define Z180_TMDR1H_WMASK 0xff /* 16 TIMER reload register ch 1 L */ #define Z180_RLDR1L_RESET 0x00 #define Z180_RLDR1L_RMASK 0xff #define Z180_RLDR1L_WMASK 0xff /* 17 TIMER reload register ch 1 H */ #define Z180_RLDR1H_RESET 0x00 #define Z180_RLDR1H_RMASK 0xff #define Z180_RLDR1H_WMASK 0xff /* 18 free running counter */ #define Z180_FRC_RESET 0x00 #define Z180_FRC_RMASK 0xff #define Z180_FRC_WMASK 0xff /* 19 reserved */ #define Z180_IO19_RESET 0x00 #define Z180_IO19_RMASK 0xff #define Z180_IO19_WMASK 0xff /* 1a ASCI time constant ch 0 L */ #define Z180_ASTC0L_RESET 0x00 #define Z180_ASTC0L_RMASK 0xff #define Z180_ASTC0L_WMASK 0xff /* 1b ASCI time constant ch 0 H */ #define Z180_ASTC0H_RESET 0x00 #define Z180_ASTC0H_RMASK 0xff #define Z180_ASTC0H_WMASK 0xff /* 1c ASCI time constant ch 1 L */ #define Z180_ASTC1L_RESET 0x00 #define Z180_ASTC1L_RMASK 0xff #define Z180_ASTC1L_WMASK 0xff /* 1d ASCI time constant ch 1 H */ #define Z180_ASTC1H_RESET 0x00 #define Z180_ASTC1H_RMASK 0xff #define Z180_ASTC1H_WMASK 0xff /* 1e clock multiplier */ #define Z180_CMR_X2 0x80 #define Z180_CMR_RESET 0x7f #define Z180_CMR_RMASK 0x80 #define Z180_CMR_WMASK 0x80 /* 1f chip control register */ #define Z180_CCR_CLOCK_DIVIDE 0x80 #define Z180_CCR_STDBY_IDLE1 0x40 #define Z180_CCR_BREXT 0x20 #define Z180_CCR_LNPHI 0x10 #define Z180_CCR_STDBY_IDLE0 0x08 #define Z180_CCR_LNIO 0x04 #define Z180_CCR_LNCPU_CTL 0x02 #define Z180_CCR_LNAD_DATA 0x01 #define Z180_CCR_RESET 0x00 #define Z180_CCR_RMASK 0xff #define Z180_CCR_WMASK 0xff /* 20 DMA source address register ch 0 L */ #define Z180_SAR0L_SAR 0xff #define Z180_SAR0L_RESET 0x00 #define Z180_SAR0L_RMASK 0xff #define Z180_SAR0L_WMASK 0xff /* 21 DMA source address register ch 0 H */ #define Z180_SAR0H_SAR 0xff #define Z180_SAR0H_RESET 0x00 #define Z180_SAR0H_RMASK 0xff #define Z180_SAR0H_WMASK 0xff /* 22 DMA source address register ch 0 B */ #define Z180_SAR0B_SAR 0x0f #define Z180_SAR0B_RESET 0x00 #define Z180_SAR0B_RMASK 0x0f #define Z180_SAR0B_WMASK 0x0f /* 23 DMA destination address register ch 0 L */ #define Z180_DAR0L_DAR 0xff #define Z180_DAR0L_RESET 0x00 #define Z180_DAR0L_RMASK 0xff #define Z180_DAR0L_WMASK 0xff /* 24 DMA destination address register ch 0 H */ #define Z180_DAR0H_DAR 0xff #define Z180_DAR0H_RESET 0x00 #define Z180_DAR0H_RMASK 0xff #define Z180_DAR0H_WMASK 0xff /* 25 DMA destination address register ch 0 B */ #define Z180_DAR0B_DAR 0x00 #define Z180_DAR0B_RESET 0x00 #define Z180_DAR0B_RMASK 0x0f #define Z180_DAR0B_WMASK 0x0f /* 26 DMA byte count register ch 0 L */ #define Z180_BCR0L_BCR 0xff #define Z180_BCR0L_RESET 0x00 #define Z180_BCR0L_RMASK 0xff #define Z180_BCR0L_WMASK 0xff /* 27 DMA byte count register ch 0 H */ #define Z180_BCR0H_BCR 0xff #define Z180_BCR0H_RESET 0x00 #define Z180_BCR0H_RMASK 0xff #define Z180_BCR0H_WMASK 0xff /* 28 DMA memory address register ch 1 L */ #define Z180_MAR1L_MAR 0xff #define Z180_MAR1L_RESET 0x00 #define Z180_MAR1L_RMASK 0xff #define Z180_MAR1L_WMASK 0xff /* 29 DMA memory address register ch 1 H */ #define Z180_MAR1H_MAR 0xff #define Z180_MAR1H_RESET 0x00 #define Z180_MAR1H_RMASK 0xff #define Z180_MAR1H_WMASK 0xff /* 2a DMA memory address register ch 1 B */ #define Z180_MAR1B_MAR 0x0f #define Z180_MAR1B_RESET 0x00 #define Z180_MAR1B_RMASK 0x0f #define Z180_MAR1B_WMASK 0x0f /* 2b DMA I/O address register ch 1 L */ #define Z180_IAR1L_IAR 0xff #define Z180_IAR1L_RESET 0x00 #define Z180_IAR1L_RMASK 0xff #define Z180_IAR1L_WMASK 0xff /* 2c DMA I/O address register ch 1 H */ #define Z180_IAR1H_IAR 0xff #define Z180_IAR1H_RESET 0x00 #define Z180_IAR1H_RMASK 0xff #define Z180_IAR1H_WMASK 0xff /* 2d (Z8S180/Z8L180) DMA I/O address register ch 1 B */ #define Z180_IAR1B_IAR 0x0f #define Z180_IAR1B_RESET 0x00 #define Z180_IAR1B_RMASK 0x0f #define Z180_IAR1B_WMASK 0x0f /* 2e DMA byte count register ch 1 L */ #define Z180_BCR1L_BCR 0xff #define Z180_BCR1L_RESET 0x00 #define Z180_BCR1L_RMASK 0xff #define Z180_BCR1L_WMASK 0xff /* 2f DMA byte count register ch 1 H */ #define Z180_BCR1H_BCR 0xff #define Z180_BCR1H_RESET 0x00 #define Z180_BCR1H_RMASK 0xff #define Z180_BCR1H_WMASK 0xff /* 30 DMA status register */ #define Z180_DSTAT_DE1 0x80 /* DMA enable ch 1 */ #define Z180_DSTAT_DE0 0x40 /* DMA enable ch 0 */ #define Z180_DSTAT_DWE1 0x20 /* DMA write enable ch 0 (active low) */ #define Z180_DSTAT_DWE0 0x10 /* DMA write enable ch 1 (active low) */ #define Z180_DSTAT_DIE1 0x08 /* DMA IRQ enable ch 1 */ #define Z180_DSTAT_DIE0 0x04 /* DMA IRQ enable ch 0 */ #define Z180_DSTAT_DME 0x01 /* DMA enable (read only) */ #define Z180_DSTAT_RESET 0x30 #define Z180_DSTAT_RMASK 0xfd #define Z180_DSTAT_WMASK 0xcc /* 31 DMA mode register */ #define Z180_DMODE_DM 0x30 #define Z180_DMODE_SM 0x0c #define Z180_DMODE_MMOD 0x04 #define Z180_DMODE_RESET 0x00 #define Z180_DMODE_RMASK 0x3e #define Z180_DMODE_WMASK 0x3e /* 32 DMA/WAIT control register */ #define Z180_DCNTL_MWI1 0x80 #define Z180_DCNTL_MWI0 0x40 #define Z180_DCNTL_IWI1 0x20 #define Z180_DCNTL_IWI0 0x10 #define Z180_DCNTL_DMS1 0x08 #define Z180_DCNTL_DMS0 0x04 #define Z180_DCNTL_DIM1 0x02 #define Z180_DCNTL_DIM0 0x01 #define Z180_DCNTL_RESET 0x00 #define Z180_DCNTL_RMASK 0xff #define Z180_DCNTL_WMASK 0xff /* 33 INT vector low register */ #define Z180_IL_IL 0xe0 #define Z180_IL_RESET 0x00 #define Z180_IL_RMASK 0xe0 #define Z180_IL_WMASK 0xe0 /* 34 INT/TRAP control register */ #define Z180_ITC_TRAP 0x80 #define Z180_ITC_UFO 0x40 #define Z180_ITC_ITE2 0x04 #define Z180_ITC_ITE1 0x02 #define Z180_ITC_ITE0 0x01 #define Z180_ITC_RESET 0x01 #define Z180_ITC_RMASK 0xc7 #define Z180_ITC_WMASK 0x87 /* 35 reserved */ #define Z180_IO35_RESET 0x00 #define Z180_IO35_RMASK 0xff #define Z180_IO35_WMASK 0xff /* 36 refresh control register */ #define Z180_RCR_REFE 0x80 #define Z180_RCR_REFW 0x80 #define Z180_RCR_CYC 0x03 #define Z180_RCR_RESET 0xc0 #define Z180_RCR_RMASK 0xc3 #define Z180_RCR_WMASK 0xc3 /* 37 reserved */ #define Z180_IO37_RESET 0x00 #define Z180_IO37_RMASK 0xff #define Z180_IO37_WMASK 0xff /* 38 MMU common base register */ #define Z180_CBR_CB 0xff #define Z180_CBR_RESET 0x00 #define Z180_CBR_RMASK 0xff #define Z180_CBR_WMASK 0xff /* 39 MMU bank base register */ #define Z180_BBR_BB 0xff #define Z180_BBR_RESET 0x00 #define Z180_BBR_RMASK 0xff #define Z180_BBR_WMASK 0xff /* 3a MMU common/bank area register */ #define Z180_CBAR_CA 0xf0 #define Z180_CBAR_BA 0x0f #define Z180_CBAR_RESET 0xf0 #define Z180_CBAR_RMASK 0xff #define Z180_CBAR_WMASK 0xff /* 3b reserved */ #define Z180_IO3B_RESET 0x00 #define Z180_IO3B_RMASK 0xff #define Z180_IO3B_WMASK 0xff /* 3c reserved */ #define Z180_IO3C_RESET 0x00 #define Z180_IO3C_RMASK 0xff #define Z180_IO3C_WMASK 0xff /* 3d reserved */ #define Z180_IO3D_RESET 0x00 #define Z180_IO3D_RMASK 0xff #define Z180_IO3D_WMASK 0xff /* 3e operation mode control register */ #define Z180_OMCR_RESET 0x00 #define Z180_OMCR_RMASK 0xff #define Z180_OMCR_WMASK 0xff /* 3f I/O control register */ #define Z180_IOCR_RESET 0x00 #define Z180_IOCR_RMASK 0xff #define Z180_IOCR_WMASK 0xff int z180_icount; static Z180_Regs Z180; static UINT32 EA; static int after_EI = 0; static UINT8 SZ[256]; /* zero and sign flags */ static UINT8 SZ_BIT[256]; /* zero, sign and parity/overflow (=zero) flags for BIT opcode */ static UINT8 SZP[256]; /* zero, sign and parity flags */ static UINT8 SZHV_inc[256]; /* zero, sign, half carry and overflow flags INC r8 */ static UINT8 SZHV_dec[256]; /* zero, sign, half carry and overflow flags DEC r8 */ #if BIG_FLAGS_ARRAY static UINT8 *SZHVC_add = 0; static UINT8 *SZHVC_sub = 0; #endif /**************************************************************************** * Burn an odd amount of cycles, that is instructions taking something * different from 4 T-states per opcode (and R increment) ****************************************************************************/ static INLINE void BURNODD(int cycles, int opcodes, int cyclesum) { if( cycles > 0 ) { _R += (cycles / cyclesum) * opcodes; z180_icount -= (cycles / cyclesum) * cyclesum; } } static data8_t z180_readcontrol(offs_t port); static void z180_writecontrol(offs_t port, data8_t data); static void z180_dma0(void); static void z180_dma1(void); #include "z180daa.h" #include "z180ops.h" #include "z180tbl.h" #include "z180cb.c" #include "z180xy.c" #include "z180dd.c" #include "z180fd.c" #include "z180ed.c" #include "z180op.c" static data8_t z180_readcontrol(offs_t port) { /* normal external readport */ data8_t data = cpu_readport16(port); /* but ignore the data and read the internal register */ switch ((port & 0x3f) + Z180_CNTLA0) { case Z180_CNTLA0: data = IO_CNTLA0 & Z180_CNTLA0_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d CNTLA0 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_CNTLA1: data = IO_CNTLA1 & Z180_CNTLA1_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d CNTLA1 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_CNTLB0: data = IO_CNTLB0 & Z180_CNTLB0_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d CNTLB0 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_CNTLB1: data = IO_CNTLB1 & Z180_CNTLB1_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d CNTLB1 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_STAT0: data = IO_STAT0 & Z180_STAT0_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d STAT0 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_STAT1: data = IO_STAT1 & Z180_STAT1_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d STAT1 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_TDR0: data = IO_TDR0 & Z180_TDR0_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d TDR0 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_TDR1: data = IO_TDR1 & Z180_TDR1_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d TDR1 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_RDR0: data = IO_RDR0 & Z180_RDR0_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d RDR0 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_RDR1: data = IO_RDR1 & Z180_RDR1_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d RDR1 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_CNTR: data = IO_CNTR & Z180_CNTR_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d CNTR rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_TRDR: data = IO_TRDR & Z180_TRDR_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d TRDR rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_TMDR0L: data = IO_TMDR0L & Z180_TMDR0L_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d TMDR0L rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); /* if timer is counting, latch the MSB and set the latch flag */ if ((IO_TCR & Z180_TCR_TDE0) == 0) { Z180.tmdr_latch |= 1; Z180.tmdr[0] = IO_TMDR0H; } break; case Z180_TMDR0H: /* read latched value? */ if (Z180.tmdr_latch & 1) { Z180.tmdr_latch &= ~1; data = Z180.tmdr[0] & Z180_TMDR1H_RMASK; } else { data = IO_TMDR0H & Z180_TMDR0H_RMASK; } log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d TMDR0H rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_RLDR0L: data = IO_RLDR0L & Z180_RLDR0L_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d RLDR0L rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_RLDR0H: data = IO_RLDR0H & Z180_RLDR0H_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d RLDR0H rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_TCR: data = IO_TCR & Z180_TCR_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d TCR rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_IO11: data = IO_IO11 & Z180_IO11_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d IO11 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_ASEXT0: data = IO_ASEXT0 & Z180_ASEXT0_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d ASEXT0 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_ASEXT1: data = IO_ASEXT1 & Z180_ASEXT1_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d ASEXT1 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_TMDR1L: data = IO_TMDR1L & Z180_TMDR1L_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d TMDR1L rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); /* if timer is counting, latch the MSB and set the latch flag */ if ((IO_TCR & Z180_TCR_TDE1) == 0) { Z180.tmdr_latch |= 2; Z180.tmdr[1] = IO_TMDR1H; } break; case Z180_TMDR1H: /* read latched value? */ if (Z180.tmdr_latch & 2) { Z180.tmdr_latch &= ~2; data = Z180.tmdr[0] & Z180_TMDR1H_RMASK; } else { data = IO_TMDR1H & Z180_TMDR1H_RMASK; } log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d TMDR1H rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_RLDR1L: data = IO_RLDR1L & Z180_RLDR1L_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d RLDR1L rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_RLDR1H: data = IO_RLDR1H & Z180_RLDR1H_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d RLDR1H rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_FRC: data = IO_FRC & Z180_FRC_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d FRC rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_IO19: data = IO_IO19 & Z180_IO19_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d IO19 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_ASTC0L: data = IO_ASTC0L & Z180_ASTC0L_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d ASTC0L rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_ASTC0H: data = IO_ASTC0H & Z180_ASTC0H_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d ASTC0H rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_ASTC1L: data = IO_ASTC1L & Z180_ASTC1L_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d ASTC1L rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_ASTC1H: data = IO_ASTC1H & Z180_ASTC1H_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d ASTC1H rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_CMR: data = IO_CMR & Z180_CMR_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d CMR rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_CCR: data = IO_CCR & Z180_CCR_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d CCR rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_SAR0L: data = IO_SAR0L & Z180_SAR0L_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d SAR0L rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_SAR0H: data = IO_SAR0H & Z180_SAR0H_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d SAR0H rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_SAR0B: data = IO_SAR0B & Z180_SAR0B_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d SAR0B rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_DAR0L: data = IO_DAR0L & Z180_DAR0L_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d DAR0L rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_DAR0H: data = IO_DAR0H & Z180_DAR0H_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d DAR0H rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_DAR0B: data = IO_DAR0B & Z180_DAR0B_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d DAR0B rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_BCR0L: data = IO_BCR0L & Z180_BCR0L_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d BCR0L rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_BCR0H: data = IO_BCR0H & Z180_BCR0H_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d BCR0H rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_MAR1L: data = IO_MAR1L & Z180_MAR1L_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d MAR1L rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_MAR1H: data = IO_MAR1H & Z180_MAR1H_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d MAR1H rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_MAR1B: data = IO_MAR1B & Z180_MAR1B_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d MAR1B rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_IAR1L: data = IO_IAR1L & Z180_IAR1L_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d IAR1L rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_IAR1H: data = IO_IAR1H & Z180_IAR1H_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d IAR1H rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_IAR1B: data = IO_IAR1B & Z180_IAR1B_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d IAR1B rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_BCR1L: data = IO_BCR1L & Z180_BCR1L_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d BCR1L rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_BCR1H: data = IO_BCR1H & Z180_BCR1H_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d BCR1H rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_DSTAT: data = IO_DSTAT & Z180_DSTAT_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d DSTAT rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_DMODE: data = IO_DMODE & Z180_DMODE_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d DMODE rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_DCNTL: data = IO_DCNTL & Z180_DCNTL_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d DCNTL rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_IL: data = IO_IL & Z180_IL_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d IL rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_ITC: data = IO_ITC & Z180_ITC_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d ITC rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_IO35: data = IO_IO35 & Z180_IO35_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d IO35 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_RCR: data = IO_RCR & Z180_RCR_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d RCR rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_IO37: data = IO_IO37 & Z180_IO37_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d IO37 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_CBR: data = IO_CBR & Z180_CBR_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d CBR rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_BBR: data = IO_BBR & Z180_BBR_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d BBR rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_CBAR: data = IO_CBAR & Z180_CBAR_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d CBAR rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_IO3B: data = IO_IO3B & Z180_IO3B_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d IO3B rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_IO3C: data = IO_IO3C & Z180_IO3C_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d IO3C rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_IO3D: data = IO_IO3D & Z180_IO3D_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d IO3D rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_OMCR: data = IO_OMCR & Z180_OMCR_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d OMCR rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; case Z180_IOCR: data = IO_IOCR & Z180_IOCR_RMASK; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d IOCR rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]); break; } return data; } static void z180_writecontrol(offs_t port, data8_t data) { /* normal external write port */ cpu_writeport16(port, data); /* store the data in the internal register */ switch ((port & 0x3f) + Z180_CNTLA0) { case Z180_CNTLA0: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d CNTLA0 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_CNTLA0_WMASK); IO_CNTLA0 = (IO_CNTLA0 & ~Z180_CNTLA0_WMASK) | (data & Z180_CNTLA0_WMASK); break; case Z180_CNTLA1: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d CNTLA1 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_CNTLA1_WMASK); IO_CNTLA1 = (IO_CNTLA1 & ~Z180_CNTLA1_WMASK) | (data & Z180_CNTLA1_WMASK); break; case Z180_CNTLB0: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d CNTLB0 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_CNTLB0_WMASK); IO_CNTLB0 = (IO_CNTLB0 & ~Z180_CNTLB0_WMASK) | (data & Z180_CNTLB0_WMASK); break; case Z180_CNTLB1: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d CNTLB1 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_CNTLB1_WMASK); IO_CNTLB1 = (IO_CNTLB1 & ~Z180_CNTLB1_WMASK) | (data & Z180_CNTLB1_WMASK); break; case Z180_STAT0: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d STAT0 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_STAT0_WMASK); IO_STAT0 = (IO_STAT0 & ~Z180_STAT0_WMASK) | (data & Z180_STAT0_WMASK); break; case Z180_STAT1: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d STAT1 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_STAT1_WMASK); IO_STAT1 = (IO_STAT1 & ~Z180_STAT1_WMASK) | (data & Z180_STAT1_WMASK); break; case Z180_TDR0: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d TDR0 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_TDR0_WMASK); IO_TDR0 = (IO_TDR0 & ~Z180_TDR0_WMASK) | (data & Z180_TDR0_WMASK); break; case Z180_TDR1: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d TDR1 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_TDR1_WMASK); IO_TDR1 = (IO_TDR1 & ~Z180_TDR1_WMASK) | (data & Z180_TDR1_WMASK); break; case Z180_RDR0: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d RDR0 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_RDR0_WMASK); IO_RDR0 = (IO_RDR0 & ~Z180_RDR0_WMASK) | (data & Z180_RDR0_WMASK); break; case Z180_RDR1: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d RDR1 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_RDR1_WMASK); IO_RDR1 = (IO_RDR1 & ~Z180_RDR1_WMASK) | (data & Z180_RDR1_WMASK); break; case Z180_CNTR: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d CNTR wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_CNTR_WMASK); IO_CNTR = (IO_CNTR & ~Z180_CNTR_WMASK) | (data & Z180_CNTR_WMASK); break; case Z180_TRDR: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d TRDR wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_TRDR_WMASK); IO_TRDR = (IO_TRDR & ~Z180_TRDR_WMASK) | (data & Z180_TRDR_WMASK); break; case Z180_TMDR0L: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d TMDR0L wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_TMDR0L_WMASK); IO_TMDR0L = (IO_TMDR0L & ~Z180_TMDR0L_WMASK) | (data & Z180_TMDR0L_WMASK); break; case Z180_TMDR0H: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d TMDR0H wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_TMDR0H_WMASK); IO_TMDR0H = (IO_TMDR0H & ~Z180_TMDR0H_WMASK) | (data & Z180_TMDR0H_WMASK); break; case Z180_RLDR0L: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d RLDR0L wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_RLDR0L_WMASK); IO_RLDR0L = (IO_RLDR0L & ~Z180_RLDR0L_WMASK) | (data & Z180_RLDR0L_WMASK); break; case Z180_RLDR0H: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d RLDR0H wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_RLDR0H_WMASK); IO_RLDR0H = (IO_RLDR0H & ~Z180_RLDR0H_WMASK) | (data & Z180_RLDR0H_WMASK); break; case Z180_TCR: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d TCR wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_TCR_WMASK); IO_TCR = (IO_TCR & ~Z180_TCR_WMASK) | (data & Z180_TCR_WMASK); break; case Z180_IO11: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d IO11 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_IO11_WMASK); IO_IO11 = (IO_IO11 & ~Z180_IO11_WMASK) | (data & Z180_IO11_WMASK); break; case Z180_ASEXT0: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d ASEXT0 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_ASEXT0_WMASK); IO_ASEXT0 = (IO_ASEXT0 & ~Z180_ASEXT0_WMASK) | (data & Z180_ASEXT0_WMASK); break; case Z180_ASEXT1: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d ASEXT1 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_ASEXT1_WMASK); IO_ASEXT1 = (IO_ASEXT1 & ~Z180_ASEXT1_WMASK) | (data & Z180_ASEXT1_WMASK); break; case Z180_TMDR1L: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d TMDR1L wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_TMDR1L_WMASK); IO_TMDR1L = (IO_TMDR1L & ~Z180_TMDR1L_WMASK) | (data & Z180_TMDR1L_WMASK); break; case Z180_TMDR1H: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d TMDR1H wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_TMDR1H_WMASK); IO_TMDR1H = (IO_TMDR1H & ~Z180_TMDR1H_WMASK) | (data & Z180_TMDR1H_WMASK); break; case Z180_RLDR1L: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d RLDR1L wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_RLDR1L_WMASK); IO_RLDR1L = (IO_RLDR1L & ~Z180_RLDR1L_WMASK) | (data & Z180_RLDR1L_WMASK); break; case Z180_RLDR1H: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d RLDR1H wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_RLDR1H_WMASK); IO_RLDR1H = (IO_RLDR1H & ~Z180_RLDR1H_WMASK) | (data & Z180_RLDR1H_WMASK); break; case Z180_FRC: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d FRC wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_FRC_WMASK); IO_FRC = (IO_FRC & ~Z180_FRC_WMASK) | (data & Z180_FRC_WMASK); break; case Z180_IO19: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d IO19 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_IO19_WMASK); IO_IO19 = (IO_IO19 & ~Z180_IO19_WMASK) | (data & Z180_IO19_WMASK); break; case Z180_ASTC0L: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d ASTC0L wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_ASTC0L_WMASK); IO_ASTC0L = (IO_ASTC0L & ~Z180_ASTC0L_WMASK) | (data & Z180_ASTC0L_WMASK); break; case Z180_ASTC0H: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d ASTC0H wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_ASTC0H_WMASK); IO_ASTC0H = (IO_ASTC0H & ~Z180_ASTC0H_WMASK) | (data & Z180_ASTC0H_WMASK); break; case Z180_ASTC1L: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d ASTC1L wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_ASTC1L_WMASK); IO_ASTC1L = (IO_ASTC1L & ~Z180_ASTC1L_WMASK) | (data & Z180_ASTC1L_WMASK); break; case Z180_ASTC1H: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d ASTC1H wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_ASTC1H_WMASK); IO_ASTC1H = (IO_ASTC1H & ~Z180_ASTC1H_WMASK) | (data & Z180_ASTC1H_WMASK); break; case Z180_CMR: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d CMR wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_CMR_WMASK); IO_CMR = (IO_CMR & ~Z180_CMR_WMASK) | (data & Z180_CMR_WMASK); break; case Z180_CCR: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d CCR wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_CCR_WMASK); IO_CCR = (IO_CCR & ~Z180_CCR_WMASK) | (data & Z180_CCR_WMASK); break; case Z180_SAR0L: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d SAR0L wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_SAR0L_WMASK); IO_SAR0L = (IO_SAR0L & ~Z180_SAR0L_WMASK) | (data & Z180_SAR0L_WMASK); break; case Z180_SAR0H: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d SAR0H wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_SAR0H_WMASK); IO_SAR0H = (IO_SAR0H & ~Z180_SAR0H_WMASK) | (data & Z180_SAR0H_WMASK); break; case Z180_SAR0B: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d SAR0B wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_SAR0B_WMASK); IO_SAR0B = (IO_SAR0B & ~Z180_SAR0B_WMASK) | (data & Z180_SAR0B_WMASK); break; case Z180_DAR0L: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d DAR0L wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_DAR0L_WMASK); IO_DAR0L = (IO_DAR0L & ~Z180_DAR0L_WMASK) | (data & Z180_DAR0L_WMASK); break; case Z180_DAR0H: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d DAR0H wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_DAR0H_WMASK); IO_DAR0H = (IO_DAR0H & ~Z180_DAR0H_WMASK) | (data & Z180_DAR0H_WMASK); break; case Z180_DAR0B: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d DAR0B wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_DAR0B_WMASK); IO_DAR0B = (IO_DAR0B & ~Z180_DAR0B_WMASK) | (data & Z180_DAR0B_WMASK); break; case Z180_BCR0L: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d BCR0L wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_BCR0L_WMASK); IO_BCR0L = (IO_BCR0L & ~Z180_BCR0L_WMASK) | (data & Z180_BCR0L_WMASK); break; case Z180_BCR0H: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d BCR0H wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_BCR0H_WMASK); IO_BCR0H = (IO_BCR0H & ~Z180_BCR0H_WMASK) | (data & Z180_BCR0H_WMASK); break; case Z180_MAR1L: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d MAR1L wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_MAR1L_WMASK); IO_MAR1L = (IO_MAR1L & ~Z180_MAR1L_WMASK) | (data & Z180_MAR1L_WMASK); break; case Z180_MAR1H: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d MAR1H wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_MAR1H_WMASK); IO_MAR1H = (IO_MAR1H & ~Z180_MAR1H_WMASK) | (data & Z180_MAR1H_WMASK); break; case Z180_MAR1B: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d MAR1B wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_MAR1B_WMASK); IO_MAR1B = (IO_MAR1B & ~Z180_MAR1B_WMASK) | (data & Z180_MAR1B_WMASK); break; case Z180_IAR1L: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d IAR1L wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_IAR1L_WMASK); IO_IAR1L = (IO_IAR1L & ~Z180_IAR1L_WMASK) | (data & Z180_IAR1L_WMASK); break; case Z180_IAR1H: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d IAR1H wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_IAR1H_WMASK); IO_IAR1H = (IO_IAR1H & ~Z180_IAR1H_WMASK) | (data & Z180_IAR1H_WMASK); break; case Z180_IAR1B: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d IAR1B wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_IAR1B_WMASK); IO_IAR1B = (IO_IAR1B & ~Z180_IAR1B_WMASK) | (data & Z180_IAR1B_WMASK); break; case Z180_BCR1L: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d BCR1L wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_BCR1L_WMASK); IO_BCR1L = (IO_BCR1L & ~Z180_BCR1L_WMASK) | (data & Z180_BCR1L_WMASK); break; case Z180_BCR1H: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d BCR1H wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_BCR1H_WMASK); IO_BCR1H = (IO_BCR1H & ~Z180_BCR1H_WMASK) | (data & Z180_BCR1H_WMASK); break; case Z180_DSTAT: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d DSTAT wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_DSTAT_WMASK); IO_DSTAT = (IO_DSTAT & ~Z180_DSTAT_WMASK) | (data & Z180_DSTAT_WMASK); if ((data & (Z180_DSTAT_DE1 | Z180_DSTAT_DWE1)) == Z180_DSTAT_DE1) IO_DSTAT |= Z180_DSTAT_DME; /* DMA enable */ if ((data & (Z180_DSTAT_DE0 | Z180_DSTAT_DWE0)) == Z180_DSTAT_DE0) IO_DSTAT |= Z180_DSTAT_DME; /* DMA enable */ break; case Z180_DMODE: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d DMODE wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_DMODE_WMASK); IO_DMODE = (IO_DMODE & ~Z180_DMODE_WMASK) | (data & Z180_DMODE_WMASK); break; case Z180_DCNTL: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d DCNTL wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_DCNTL_WMASK); IO_DCNTL = (IO_DCNTL & ~Z180_DCNTL_WMASK) | (data & Z180_DCNTL_WMASK); break; case Z180_IL: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d IL wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_IL_WMASK); IO_IL = (IO_IL & ~Z180_IL_WMASK) | (data & Z180_IL_WMASK); break; case Z180_ITC: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d ITC wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_ITC_WMASK); IO_ITC = (IO_ITC & ~Z180_ITC_WMASK) | (data & Z180_ITC_WMASK); break; case Z180_IO35: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d IO35 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_IO35_WMASK); IO_IO35 = (IO_IO35 & ~Z180_IO35_WMASK) | (data & Z180_IO35_WMASK); break; case Z180_RCR: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d RCR wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_RCR_WMASK); IO_RCR = (IO_RCR & ~Z180_RCR_WMASK) | (data & Z180_RCR_WMASK); break; case Z180_IO37: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d IO37 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_IO37_WMASK); IO_IO37 = (IO_IO37 & ~Z180_IO37_WMASK) | (data & Z180_IO37_WMASK); break; case Z180_CBR: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d CBR wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_CBR_WMASK); IO_CBR = (IO_CBR & ~Z180_CBR_WMASK) | (data & Z180_CBR_WMASK); z180_mmu(); break; case Z180_BBR: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d BBR wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_BBR_WMASK); IO_BBR = (IO_BBR & ~Z180_BBR_WMASK) | (data & Z180_BBR_WMASK); z180_mmu(); break; case Z180_CBAR: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d CBAR wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_CBAR_WMASK); IO_CBAR = (IO_CBAR & ~Z180_CBAR_WMASK) | (data & Z180_CBAR_WMASK); z180_mmu(); break; case Z180_IO3B: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d IO3B wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_IO3B_WMASK); IO_IO3B = (IO_IO3B & ~Z180_IO3B_WMASK) | (data & Z180_IO3B_WMASK); break; case Z180_IO3C: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d IO3C wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_IO3C_WMASK); IO_IO3C = (IO_IO3C & ~Z180_IO3C_WMASK) | (data & Z180_IO3C_WMASK); break; case Z180_IO3D: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d IO3D wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_IO3D_WMASK); IO_IO3D = (IO_IO3D & ~Z180_IO3D_WMASK) | (data & Z180_IO3D_WMASK); break; case Z180_OMCR: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d OMCR wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_OMCR_WMASK); IO_OMCR = (IO_OMCR & ~Z180_OMCR_WMASK) | (data & Z180_OMCR_WMASK); break; case Z180_IOCR: log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d IOCR wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_IOCR_WMASK); IO_IOCR = (IO_IOCR & ~Z180_IOCR_WMASK) | (data & Z180_IOCR_WMASK); break; } } static void z180_dma0(void) { offs_t sar0 = 65536 * IO_SAR0B + 256 * IO_SAR0H + IO_SAR0L; offs_t dar0 = 65536 * IO_DAR0B + 256 * IO_DAR0H + IO_DAR0L; int bcr0 = 256 * IO_BCR0H + IO_BCR0L; int count = (IO_DMODE & Z180_DMODE_MMOD)? bcr0 : 1; if (bcr0 == 0) { IO_DSTAT &= ~Z180_DSTAT_DE0; return; } while (count-- > 0) { /* last transfer happening now? */ if (bcr0 == 1) { Z180.iol |= Z180_TEND0; } switch( IO_DMODE & (Z180_DMODE_SM | Z180_DMODE_DM) ) { case 0x00: /* memory SAR0+1 to memory DAR0+1 */ cpu_writemem20(dar0++, cpu_readmem20(sar0++)); break; case 0x04: /* memory SAR0-1 to memory DAR0+1 */ cpu_writemem20(dar0++, cpu_readmem20(sar0--)); break; case 0x08: /* memory SAR0 fixed to memory DAR0+1 */ cpu_writemem20(dar0++, cpu_readmem20(sar0)); break; case 0x0c: /* I/O SAR0 fixed to memory DAR0+1 */ if (Z180.iol & Z180_DREQ0) { cpu_writemem20(dar0++, IN(sar0)); /* edge sensitive DREQ0? */ if (IO_DCNTL & Z180_DCNTL_DIM0) { Z180.iol &= ~Z180_DREQ0; count = 0; } } break; case 0x10: /* memory SAR0+1 to memory DAR0-1 */ cpu_writemem20(dar0--, cpu_readmem20(sar0++)); break; case 0x14: /* memory SAR0-1 to memory DAR0-1 */ cpu_writemem20(dar0--, cpu_readmem20(sar0--)); break; case 0x18: /* memory SAR0 fixed to memory DAR0-1 */ cpu_writemem20(dar0--, cpu_readmem20(sar0)); break; case 0x1c: /* I/O SAR0 fixed to memory DAR0-1 */ if (Z180.iol & Z180_DREQ0) { cpu_writemem20(dar0--, IN(sar0)); /* edge sensitive DREQ0? */ if (IO_DCNTL & Z180_DCNTL_DIM0) { Z180.iol &= ~Z180_DREQ0; count = 0; } } break; case 0x20: /* memory SAR0+1 to memory DAR0 fixed */ cpu_writemem20(dar0, cpu_readmem20(sar0++)); break; case 0x24: /* memory SAR0-1 to memory DAR0 fixed */ cpu_writemem20(dar0, cpu_readmem20(sar0--)); break; case 0x28: /* reserved */ break; case 0x2c: /* reserved */ break; case 0x30: /* memory SAR0+1 to I/O DAR0 fixed */ if (Z180.iol & Z180_DREQ0) { OUT(dar0, cpu_readmem20(sar0++)); /* edge sensitive DREQ0? */ if (IO_DCNTL & Z180_DCNTL_DIM0) { Z180.iol &= ~Z180_DREQ0; count = 0; } } break; case 0x34: /* memory SAR0-1 to I/O DAR0 fixed */ if (Z180.iol & Z180_DREQ0) { OUT(dar0, cpu_readmem20(sar0--)); /* edge sensitive DREQ0? */ if (IO_DCNTL & Z180_DCNTL_DIM0) { Z180.iol &= ~Z180_DREQ0; count = 0; } } break; case 0x38: /* reserved */ break; case 0x3c: /* reserved */ break; } bcr0--; count--; if ((z180_icount -= 6) < 0) break; } IO_SAR0L = sar0; IO_SAR0H = sar0 >> 8; IO_SAR0B = sar0 >> 16; IO_DAR0L = dar0; IO_DAR0H = dar0 >> 8; IO_DAR0B = dar0 >> 16; IO_BCR0L = bcr0; IO_BCR0H = bcr0 >> 8; /* DMA terminal count? */ if (bcr0 == 0) { Z180.iol &= ~Z180_TEND0; IO_DSTAT &= ~Z180_DSTAT_DE0; /* terminal count interrupt enabled? */ if (IO_DSTAT & Z180_DSTAT_DIE0 && _IFF1) take_interrupt(Z180_INT_DMA0); } } static void z180_dma1(void) { offs_t mar1 = 65536 * IO_MAR1B + 256 * IO_MAR1H + IO_MAR1L; offs_t iar1 = 256 * IO_IAR1H + IO_IAR1L; int bcr1 = 256 * IO_BCR1H + IO_BCR1L; if ((Z180.iol & Z180_DREQ1) == 0) return; /* counter is zero? */ if (bcr1 == 0) { IO_DSTAT &= ~Z180_DSTAT_DE1; return; } /* last transfer happening now? */ if (bcr1 == 1) { Z180.iol |= Z180_TEND1; } switch (IO_DCNTL & (Z180_DCNTL_DIM1 | Z180_DCNTL_DIM0)) { case 0x00: /* memory MAR1+1 to I/O IAR1 fixed */ cpu_writeport16(iar1, cpu_readmem20(mar1++)); break; case 0x01: /* memory MAR1-1 to I/O IAR1 fixed */ cpu_writeport16(iar1, cpu_readmem20(mar1--)); break; case 0x02: /* I/O IAR1 fixed to memory MAR1+1 */ cpu_writemem20(mar1++, cpu_readport16(iar1)); break; case 0x03: /* I/O IAR1 fixed to memory MAR1-1 */ cpu_writemem20(mar1--, cpu_readport16(iar1)); break; } /* edge sensitive DREQ1? */ if (IO_DCNTL & Z180_DCNTL_DIM1) Z180.iol &= ~Z180_DREQ1; IO_MAR1L = mar1; IO_MAR1H = mar1 >> 8; IO_MAR1B = mar1 >> 16; IO_BCR1L = bcr1; IO_BCR1H = bcr1 >> 8; /* DMA terminal count? */ if (bcr1 == 0) { Z180.iol &= ~Z180_TEND1; IO_DSTAT &= ~Z180_DSTAT_DE1; if (IO_DSTAT & Z180_DSTAT_DIE1 && _IFF1) take_interrupt(Z180_INT_DMA1); } /* six cycles per transfer (minimum) */ z180_icount -= 6; } static void z180_write_iolines(UINT32 data) { UINT32 changes = Z180.iol ^ data; /* I/O asynchronous clock 0 (active high) or DREQ0 (mux) */ if (changes & Z180_CKA0) { log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d CKA0 %d\n", cpu_getactivecpu(), data & Z180_CKA0? 1 : 0); Z180.iol = (Z180.iol & ~Z180_CKA0) | (data & Z180_CKA0); } /* I/O asynchronous clock 1 (active high) or TEND1 (mux) */ if (changes & Z180_CKA1) { log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d CKA1 %d\n", cpu_getactivecpu(), data & Z180_CKA1? 1 : 0); Z180.iol = (Z180.iol & ~Z180_CKA1) | (data & Z180_CKA1); } /* I/O serial clock (active high) */ if (changes & Z180_CKS) { log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d CKS %d\n", cpu_getactivecpu(), data & Z180_CKS? 1 : 0); Z180.iol = (Z180.iol & ~Z180_CKS) | (data & Z180_CKS); } /* I clear to send 0 (active low) */ if (changes & Z180_CTS0) { log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d CTS0 %d\n", cpu_getactivecpu(), data & Z180_CTS0? 1 : 0); Z180.iol = (Z180.iol & ~Z180_CTS0) | (data & Z180_CTS0); } /* I clear to send 1 (active low) or RXS (mux) */ if (changes & Z180_CTS1) { log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d CTS1 %d\n", cpu_getactivecpu(), data & Z180_CTS1? 1 : 0); Z180.iol = (Z180.iol & ~Z180_CTS1) | (data & Z180_CTS1); } /* I data carrier detect (active low) */ if (changes & Z180_DCD0) { log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d DCD0 %d\n", cpu_getactivecpu(), data & Z180_DCD0? 1 : 0); Z180.iol = (Z180.iol & ~Z180_DCD0) | (data & Z180_DCD0); } /* I data request DMA ch 0 (active low) or CKA0 (mux) */ if (changes & Z180_DREQ0) { log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d DREQ0 %d\n", cpu_getactivecpu(), data & Z180_DREQ0? 1 : 0); Z180.iol = (Z180.iol & ~Z180_DREQ0) | (data & Z180_DREQ0); } /* I data request DMA ch 1 (active low) */ if (changes & Z180_DREQ1) { log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d DREQ1 %d\n", cpu_getactivecpu(), data & Z180_DREQ1? 1 : 0); Z180.iol = (Z180.iol & ~Z180_DREQ1) | (data & Z180_DREQ1); } /* I asynchronous receive data 0 (active high) */ if (changes & Z180_RXA0) { log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d RXA0 %d\n", cpu_getactivecpu(), data & Z180_RXA0? 1 : 0); Z180.iol = (Z180.iol & ~Z180_RXA0) | (data & Z180_RXA0); } /* I asynchronous receive data 1 (active high) */ if (changes & Z180_RXA1) { log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d RXA1 %d\n", cpu_getactivecpu(), data & Z180_RXA1? 1 : 0); Z180.iol = (Z180.iol & ~Z180_RXA1) | (data & Z180_RXA1); } /* I clocked serial receive data (active high) or CTS1 (mux) */ if (changes & Z180_RXS) { log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d RXS %d\n", cpu_getactivecpu(), data & Z180_RXS? 1 : 0); Z180.iol = (Z180.iol & ~Z180_RXS) | (data & Z180_RXS); } /* O request to send (active low) */ if (changes & Z180_RTS0) { log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d RTS0 won't change output\n", cpu_getactivecpu()); } /* O transfer end 0 (active low) or CKA1 (mux) */ if (changes & Z180_TEND0) { log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d TEND0 won't change output\n", cpu_getactivecpu()); } /* O transfer end 1 (active low) */ if (changes & Z180_TEND1) { log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d TEND1 won't change output\n", cpu_getactivecpu()); } /* O transfer out (PRT channel, active low) or A18 (mux) */ if (changes & Z180_A18_TOUT) { log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d TOUT won't change output\n", cpu_getactivecpu()); } /* O asynchronous transmit data 0 (active high) */ if (changes & Z180_TXA0) { log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d TXA0 won't change output\n", cpu_getactivecpu()); } /* O asynchronous transmit data 1 (active high) */ if (changes & Z180_TXA1) { log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d TXA1 won't change output\n", cpu_getactivecpu()); } /* O clocked serial transmit data (active high) */ if (changes & Z180_TXS) { log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d TXS won't change output\n", cpu_getactivecpu()); } } void z180_init(void) { int cpu = cpu_getactivecpu(); state_save_register_UINT16("z180", cpu, "AF", &Z180.AF.w.l, 1); state_save_register_UINT16("z180", cpu, "BC", &Z180.BC.w.l, 1); state_save_register_UINT16("z180", cpu, "DE", &Z180.DE.w.l, 1); state_save_register_UINT16("z180", cpu, "HL", &Z180.HL.w.l, 1); state_save_register_UINT16("z180", cpu, "IX", &Z180.IX.w.l, 1); state_save_register_UINT16("z180", cpu, "IY", &Z180.IY.w.l, 1); state_save_register_UINT16("z180", cpu, "PC", &Z180.PC.w.l, 1); state_save_register_UINT16("z180", cpu, "SP", &Z180.SP.w.l, 1); state_save_register_UINT16("z180", cpu, "AF2", &Z180.AF2.w.l, 1); state_save_register_UINT16("z180", cpu, "BC2", &Z180.BC2.w.l, 1); state_save_register_UINT16("z180", cpu, "DE2", &Z180.DE2.w.l, 1); state_save_register_UINT16("z180", cpu, "HL2", &Z180.HL2.w.l, 1); state_save_register_UINT8("z180", cpu, "R", &Z180.R, 1); state_save_register_UINT8("z180", cpu, "R2", &Z180.R2, 1); state_save_register_UINT8("z180", cpu, "IFF1", &Z180.IFF1, 1); state_save_register_UINT8("z180", cpu, "IFF2", &Z180.IFF2, 1); state_save_register_UINT8("z180", cpu, "HALT", &Z180.HALT, 1); state_save_register_UINT8("z180", cpu, "IM", &Z180.IM, 1); state_save_register_UINT8("z180", cpu, "I", &Z180.I, 1); state_save_register_UINT8("z180", cpu, "irq_max", &Z180.irq_max, 1); state_save_register_INT8("z180", cpu, "request_irq", &Z180.request_irq, 1); state_save_register_INT8("z180", cpu, "service_irq", &Z180.service_irq, 1); state_save_register_UINT8("z180", cpu, "int_state", Z180.int_state, 4); state_save_register_UINT8("z180", cpu, "nmi_state", &Z180.nmi_state, 1); state_save_register_UINT8("z180", cpu, "int0_state", &Z180.irq_state[0], 1); state_save_register_UINT8("z180", cpu, "int1_state", &Z180.irq_state[1], 1); state_save_register_UINT8("z180", cpu, "int2_state", &Z180.irq_state[2], 1); /* daisy chain needs to be saved by z80ctc.c somehow */ } /**************************************************************************** * Reset registers to their initial values ****************************************************************************/ void z180_reset(void *param) { Z80_DaisyChain *daisy_chain = (Z80_DaisyChain *)param; int i, p; #if BIG_FLAGS_ARRAY if(!SZHVC_add ||!SZHVC_sub ) { int oldval, newval, val; UINT8 *padd, *padc, *psub, *psbc; /* allocate big flag arrays once */ SZHVC_add = (UINT8 *)malloc(2*256*256); SZHVC_sub = (UINT8 *)malloc(2*256*256); if(!SZHVC_add ||!SZHVC_sub ) { log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180: failed to allocate 2 * 128K flags arrays!!!\n"); /*raise(SIGABRT);*/ } padd = &SZHVC_add[ 0*256]; padc = &SZHVC_add[256*256]; psub = &SZHVC_sub[ 0*256]; psbc = &SZHVC_sub[256*256]; for (oldval = 0; oldval < 256; oldval++) { for (newval = 0; newval < 256; newval++) { /* add or adc w/o carry set */ val = newval - oldval; *padd = (newval)? ((newval & 0x80)? SF : 0) : ZF; #if Z180_EXACT *padd |= (newval & (YF | XF)); /* undocumented flag bits 5+3 */ #endif if( (newval & 0x0f) < (oldval & 0x0f) ) *padd |= HF; if( newval < oldval ) *padd |= CF; if( (val^oldval^0x80) & (val^newval) & 0x80 ) *padd |= VF; padd++; /* adc with carry set */ val = newval - oldval - 1; *padc = (newval)? ((newval & 0x80)? SF : 0) : ZF; #if Z180_EXACT *padc |= (newval & (YF | XF)); /* undocumented flag bits 5+3 */ #endif if( (newval & 0x0f) <= (oldval & 0x0f) ) *padc |= HF; if( newval <= oldval ) *padc |= CF; if( (val^oldval^0x80) & (val^newval) & 0x80 ) *padc |= VF; padc++; /* cp, sub or sbc w/o carry set */ val = oldval - newval; *psub = NF | ((newval)? ((newval & 0x80)? SF : 0) : ZF); #if Z180_EXACT *psub |= (newval & (YF | XF)); /* undocumented flag bits 5+3 */ #endif if( (newval & 0x0f) > (oldval & 0x0f) ) *psub |= HF; if( newval > oldval ) *psub |= CF; if( (val^oldval) & (oldval^newval) & 0x80 ) *psub |= VF; psub++; /* sbc with carry set */ val = oldval - newval - 1; *psbc = NF | ((newval)? ((newval & 0x80)? SF : 0) : ZF); #if Z180_EXACT *psbc |= (newval & (YF | XF)); /* undocumented flag bits 5+3 */ #endif if( (newval & 0x0f) >= (oldval & 0x0f) ) *psbc |= HF; if( newval >= oldval ) *psbc |= CF; if( (val^oldval) & (oldval^newval) & 0x80 ) *psbc |= VF; psbc++; } } } #endif for (i = 0; i < 256; i++) { p = 0; if( i&0x01 ) ++p; if( i&0x02 ) ++p; if( i&0x04 ) ++p; if( i&0x08 ) ++p; if( i&0x10 ) ++p; if( i&0x20 ) ++p; if( i&0x40 ) ++p; if( i&0x80 ) ++p; SZ[i] = i? i & SF : ZF; #if Z180_EXACT SZ[i] |= (i & (YF | XF)); /* undocumented flag bits 5+3 */ #endif SZ_BIT[i] = i? i & SF : ZF | PF; #if Z180_EXACT SZ_BIT[i] |= (i & (YF | XF)); /* undocumented flag bits 5+3 */ #endif SZP[i] = SZ[i] | ((p & 1)? 0 : PF); SZHV_inc[i] = SZ[i]; if( i == 0x80 ) SZHV_inc[i] |= VF; if( (i & 0x0f) == 0x00 ) SZHV_inc[i] |= HF; SZHV_dec[i] = SZ[i] | NF; if( i == 0x7f ) SZHV_dec[i] |= VF; if( (i & 0x0f) == 0x0f ) SZHV_dec[i] |= HF; } memset(&Z180, 0, sizeof(Z180)); _IX = _IY = 0xffff; /* IX and IY are FFFF after a reset! */ _F = ZF; /* Zero flag is set */ Z180.request_irq = -1; Z180.service_irq = -1; Z180.nmi_state = CLEAR_LINE; Z180.irq_state[0] = CLEAR_LINE; Z180.irq_state[1] = CLEAR_LINE; Z180.irq_state[2] = CLEAR_LINE; /* reset io registers */ IO_CNTLA0 = Z180_CNTLA0_RESET; IO_CNTLA1 = Z180_CNTLA1_RESET; IO_CNTLB0 = Z180_CNTLB0_RESET; IO_CNTLB1 = Z180_CNTLB1_RESET; IO_STAT0 = Z180_STAT0_RESET; IO_STAT1 = Z180_STAT1_RESET; IO_TDR0 = Z180_TDR0_RESET; IO_TDR1 = Z180_TDR1_RESET; IO_RDR0 = Z180_RDR0_RESET; IO_RDR1 = Z180_RDR1_RESET; IO_CNTR = Z180_CNTR_RESET; IO_TRDR = Z180_TRDR_RESET; IO_TMDR0L = Z180_TMDR0L_RESET; IO_TMDR0H = Z180_TMDR0H_RESET; IO_RLDR0L = Z180_RLDR0L_RESET; IO_RLDR0H = Z180_RLDR0H_RESET; IO_TCR = Z180_TCR_RESET; IO_IO11 = Z180_IO11_RESET; IO_ASEXT0 = Z180_ASEXT0_RESET; IO_ASEXT1 = Z180_ASEXT1_RESET; IO_TMDR1L = Z180_TMDR1L_RESET; IO_TMDR1H = Z180_TMDR1H_RESET; IO_RLDR1L = Z180_RLDR1L_RESET; IO_RLDR1H = Z180_RLDR1H_RESET; IO_FRC = Z180_FRC_RESET; IO_IO19 = Z180_IO19_RESET; IO_ASTC0L = Z180_ASTC0L_RESET; IO_ASTC0H = Z180_ASTC0H_RESET; IO_ASTC1L = Z180_ASTC1L_RESET; IO_ASTC1H = Z180_ASTC1H_RESET; IO_CMR = Z180_CMR_RESET; IO_CCR = Z180_CCR_RESET; IO_SAR0L = Z180_SAR0L_RESET; IO_SAR0H = Z180_SAR0H_RESET; IO_SAR0B = Z180_SAR0B_RESET; IO_DAR0L = Z180_DAR0L_RESET; IO_DAR0H = Z180_DAR0H_RESET; IO_DAR0B = Z180_DAR0B_RESET; IO_BCR0L = Z180_BCR0L_RESET; IO_BCR0H = Z180_BCR0H_RESET; IO_MAR1L = Z180_MAR1L_RESET; IO_MAR1H = Z180_MAR1H_RESET; IO_MAR1B = Z180_MAR1B_RESET; IO_IAR1L = Z180_IAR1L_RESET; IO_IAR1H = Z180_IAR1H_RESET; IO_IAR1B = Z180_IAR1B_RESET; IO_BCR1L = Z180_BCR1L_RESET; IO_BCR1H = Z180_BCR1H_RESET; IO_DSTAT = Z180_DSTAT_RESET; IO_DMODE = Z180_DMODE_RESET; IO_DCNTL = Z180_DCNTL_RESET; IO_IL = Z180_IL_RESET; IO_ITC = Z180_ITC_RESET; IO_IO35 = Z180_IO35_RESET; IO_RCR = Z180_RCR_RESET; IO_IO37 = Z180_IO37_RESET; IO_CBR = Z180_CBR_RESET; IO_BBR = Z180_BBR_RESET; IO_CBAR = Z180_CBAR_RESET; IO_IO3B = Z180_IO3B_RESET; IO_IO3C = Z180_IO3C_RESET; IO_IO3D = Z180_IO3D_RESET; IO_OMCR = Z180_OMCR_RESET; IO_IOCR = Z180_IOCR_RESET; if( daisy_chain ) { while( daisy_chain->irq_param!= -1 && Z180.irq_max < Z80_MAXDAISY ) { /* set callbackhandler after reti */ Z180.irq[Z180.irq_max] = *daisy_chain; /* device reset */ if( Z180.irq[Z180.irq_max].reset ) Z180.irq[Z180.irq_max].reset(Z180.irq[Z180.irq_max].irq_param); Z180.irq_max++; daisy_chain++; } } z180_mmu(); z180_change_pc(_PCD); } void z180_exit(void) { #if BIG_FLAGS_ARRAY if (SZHVC_add) free(SZHVC_add); SZHVC_add = NULL; if (SZHVC_sub) free(SZHVC_sub); SZHVC_sub = NULL; #endif } /**************************************************************************** * Execute 'cycles' T-states. Return number of T-states really executed ****************************************************************************/ int z180_execute(int cycles) { z180_icount = cycles - Z180.extra_cycles; Z180.extra_cycles = 0; again: /* check if any DMA transfer is running */ if ((IO_DSTAT & Z180_DSTAT_DME) == Z180_DSTAT_DME) { /* check if DMA channel 0 is running and also is in burst mode */ if ((IO_DSTAT & Z180_DSTAT_DE0) == Z180_DSTAT_DE0 && (IO_DMODE & Z180_DMODE_MMOD) == Z180_DMODE_MMOD) { CALL_MAME_DEBUG; z180_dma0(); } else { do { _PPC = _PCD; CALL_MAME_DEBUG; _R++; EXEC_INLINE(op,ROP()); z180_dma0(); z180_dma1(); /* If DMA is done break out to the faster loop */ if ((IO_DSTAT & Z180_DSTAT_DME)!= Z180_DSTAT_DME) break; } while( z180_icount > 0 ); } } if (z180_icount > 0) { do { _PPC = _PCD; CALL_MAME_DEBUG; _R++; EXEC_INLINE(op,ROP()); /* If DMA is started go to check the mode */ if ((IO_DSTAT & Z180_DSTAT_DME) == Z180_DSTAT_DME) goto again; } while( z180_icount > 0 ); } z180_icount -= Z180.extra_cycles; Z180.extra_cycles = 0; return cycles - z180_icount; } /**************************************************************************** * Burn 'cycles' T-states. Adjust R register for the lost time ****************************************************************************/ void z180_burn(int cycles) { if( cycles > 0 ) { /* NOP takes 3 cycles per instruction */ int n = (cycles + 2) / 3; _R += n; z180_icount -= 3 * n; } } /**************************************************************************** * Get all registers in given buffer ****************************************************************************/ unsigned z180_get_context (void *dst) { if( dst ) *(Z180_Regs*)dst = Z180; return sizeof(Z180_Regs); } /**************************************************************************** * Set all registers to given values ****************************************************************************/ void z180_set_context (void *src) { if( src ) Z180 = *(Z180_Regs*)src; z180_change_pc(_PCD); } /**************************************************************************** * Get a pointer to a cycle count table ****************************************************************************/ const void *z180_get_cycle_table (int which) { if (which >= 0 && which <= Z180_TABLE_xycb) return cc[which]; return NULL; } /**************************************************************************** * Set a new cycle count table ****************************************************************************/ void z180_set_cycle_table (int which, void *new_table) { if (which >= 0 && which <= Z180_TABLE_ex) cc[which] = new_table; } /**************************************************************************** * Return a specific register ****************************************************************************/ unsigned z180_get_reg (int regnum) { switch( regnum ) { case REG_PC: return _PCD; case Z180_PC: return Z180.PC.w.l; case REG_SP: return _SPD; case Z180_SP: return Z180.SP.w.l; case Z180_AF: return Z180.AF.w.l; case Z180_BC: return Z180.BC.w.l; case Z180_DE: return Z180.DE.w.l; case Z180_HL: return Z180.HL.w.l; case Z180_IX: return Z180.IX.w.l; case Z180_IY: return Z180.IY.w.l; case Z180_R: return (Z180.R & 0x7f) | (Z180.R2 & 0x80); case Z180_I: return Z180.I; case Z180_AF2: return Z180.AF2.w.l; case Z180_BC2: return Z180.BC2.w.l; case Z180_DE2: return Z180.DE2.w.l; case Z180_HL2: return Z180.HL2.w.l; case Z180_IM: return Z180.IM; case Z180_IFF1: return Z180.IFF1; case Z180_IFF2: return Z180.IFF2; case Z180_HALT: return Z180.HALT; case Z180_NMI_STATE: return Z180.nmi_state; case Z180_INT0_STATE: return Z180.irq_state[0]; case Z180_INT1_STATE: return Z180.irq_state[1]; case Z180_INT2_STATE: return Z180.irq_state[2]; case Z180_DC0: return Z180.int_state[0]; case Z180_DC1: return Z180.int_state[1]; case Z180_DC2: return Z180.int_state[2]; case Z180_DC3: return Z180.int_state[3]; case Z180_CNTLA0: return Z180.io[0x00]; case Z180_CNTLA1: return Z180.io[0x01]; case Z180_CNTLB0: return Z180.io[0x02]; case Z180_CNTLB1: return Z180.io[0x03]; case Z180_STAT0: return Z180.io[0x04]; case Z180_STAT1: return Z180.io[0x05]; case Z180_TDR0: return Z180.io[0x06]; case Z180_TDR1: return Z180.io[0x07]; case Z180_RDR0: return Z180.io[0x08]; case Z180_RDR1: return Z180.io[0x09]; case Z180_CNTR: return Z180.io[0x0a]; case Z180_TRDR: return Z180.io[0x0b]; case Z180_TMDR0L: return Z180.io[0x0c]; case Z180_TMDR0H: return Z180.io[0x0d]; case Z180_RLDR0L: return Z180.io[0x0e]; case Z180_RLDR0H: return Z180.io[0x0f]; case Z180_TCR: return Z180.io[0x10]; case Z180_IO11: return Z180.io[0x11]; case Z180_ASEXT0: return Z180.io[0x12]; case Z180_ASEXT1: return Z180.io[0x13]; case Z180_TMDR1L: return Z180.io[0x14]; case Z180_TMDR1H: return Z180.io[0x15]; case Z180_RLDR1L: return Z180.io[0x16]; case Z180_RLDR1H: return Z180.io[0x17]; case Z180_FRC: return Z180.io[0x18]; case Z180_IO19: return Z180.io[0x19]; case Z180_ASTC0L: return Z180.io[0x1a]; case Z180_ASTC0H: return Z180.io[0x1b]; case Z180_ASTC1L: return Z180.io[0x1c]; case Z180_ASTC1H: return Z180.io[0x1d]; case Z180_CMR: return Z180.io[0x1e]; case Z180_CCR: return Z180.io[0x1f]; case Z180_SAR0L: return Z180.io[0x20]; case Z180_SAR0H: return Z180.io[0x21]; case Z180_SAR0B: return Z180.io[0x22]; case Z180_DAR0L: return Z180.io[0x23]; case Z180_DAR0H: return Z180.io[0x24]; case Z180_DAR0B: return Z180.io[0x25]; case Z180_BCR0L: return Z180.io[0x26]; case Z180_BCR0H: return Z180.io[0x27]; case Z180_MAR1L: return Z180.io[0x28]; case Z180_MAR1H: return Z180.io[0x29]; case Z180_MAR1B: return Z180.io[0x2a]; case Z180_IAR1L: return Z180.io[0x2b]; case Z180_IAR1H: return Z180.io[0x2c]; case Z180_IAR1B: return Z180.io[0x2d]; case Z180_BCR1L: return Z180.io[0x2e]; case Z180_BCR1H: return Z180.io[0x2f]; case Z180_DSTAT: return Z180.io[0x30]; case Z180_DMODE: return Z180.io[0x31]; case Z180_DCNTL: return Z180.io[0x32]; case Z180_IL: return Z180.io[0x33]; case Z180_ITC: return Z180.io[0x34]; case Z180_IO35: return Z180.io[0x35]; case Z180_RCR: return Z180.io[0x36]; case Z180_IO37: return Z180.io[0x37]; case Z180_CBR: return Z180.io[0x38]; case Z180_BBR: return Z180.io[0x39]; case Z180_CBAR: return Z180.io[0x3a]; case Z180_IO3B: return Z180.io[0x3b]; case Z180_IO3C: return Z180.io[0x3c]; case Z180_IO3D: return Z180.io[0x3d]; case Z180_OMCR: return Z180.io[0x3e]; case Z180_IOCR: return Z180.io[0x3f]; case Z180_IOLINES: return Z180.iol; break; case REG_PREVIOUSPC: return Z180.PREPC.w.l; default: if( regnum <= REG_SP_CONTENTS ) { unsigned offset = _SPD + 2 * (REG_SP_CONTENTS - regnum); if( offset < 0xffff ) return RM( offset ) | ( RM( offset + 1) << 8 ); } } return 0; } /**************************************************************************** * Set a specific register ****************************************************************************/ void z180_set_reg (int regnum, unsigned val) { switch( regnum ) { case REG_PC: _PC = val; z180_change_pc(_PCD); break; case Z180_PC: Z180.PC.w.l = val; break; case REG_SP: _SP = val; break; case Z180_SP: Z180.SP.w.l = val; break; case Z180_AF: Z180.AF.w.l = val; break; case Z180_BC: Z180.BC.w.l = val; break; case Z180_DE: Z180.DE.w.l = val; break; case Z180_HL: Z180.HL.w.l = val; break; case Z180_IX: Z180.IX.w.l = val; break; case Z180_IY: Z180.IY.w.l = val; break; case Z180_R: Z180.R = val; Z180.R2 = val & 0x80; break; case Z180_I: Z180.I = val; break; case Z180_AF2: Z180.AF2.w.l = val; break; case Z180_BC2: Z180.BC2.w.l = val; break; case Z180_DE2: Z180.DE2.w.l = val; break; case Z180_HL2: Z180.HL2.w.l = val; break; case Z180_IM: Z180.IM = val; break; case Z180_IFF1: Z180.IFF1 = val; break; case Z180_IFF2: Z180.IFF2 = val; break; case Z180_HALT: Z180.HALT = val; break; case Z180_NMI_STATE: z180_set_irq_line(IRQ_LINE_NMI,val); break; case Z180_INT0_STATE: z180_set_irq_line(0,val); break; case Z180_INT1_STATE: z180_set_irq_line(1,val); break; case Z180_INT2_STATE: z180_set_irq_line(2,val); break; case Z180_DC0: Z180.int_state[0] = val; break; case Z180_DC1: Z180.int_state[1] = val; break; case Z180_DC2: Z180.int_state[2] = val; break; case Z180_DC3: Z180.int_state[3] = val; break; case Z180_CNTLA0: Z180.io[0x00] = val; break; case Z180_CNTLA1: Z180.io[0x01] = val; break; case Z180_CNTLB0: Z180.io[0x02] = val; break; case Z180_CNTLB1: Z180.io[0x03] = val; break; case Z180_STAT0: Z180.io[0x04] = val; break; case Z180_STAT1: Z180.io[0x05] = val; break; case Z180_TDR0: Z180.io[0x06] = val; break; case Z180_TDR1: Z180.io[0x07] = val; break; case Z180_RDR0: Z180.io[0x08] = val; break; case Z180_RDR1: Z180.io[0x09] = val; break; case Z180_CNTR: Z180.io[0x0a] = val; break; case Z180_TRDR: Z180.io[0x0b] = val; break; case Z180_TMDR0L: Z180.io[0x0c] = val; break; case Z180_TMDR0H: Z180.io[0x0d] = val; break; case Z180_RLDR0L: Z180.io[0x0e] = val; break; case Z180_RLDR0H: Z180.io[0x0f] = val; break; case Z180_TCR: Z180.io[0x10] = val; break; case Z180_IO11: Z180.io[0x11] = val; break; case Z180_ASEXT0: Z180.io[0x12] = val; break; case Z180_ASEXT1: Z180.io[0x13] = val; break; case Z180_TMDR1L: Z180.io[0x14] = val; break; case Z180_TMDR1H: Z180.io[0x15] = val; break; case Z180_RLDR1L: Z180.io[0x16] = val; break; case Z180_RLDR1H: Z180.io[0x17] = val; break; case Z180_FRC: Z180.io[0x18] = val; break; case Z180_IO19: Z180.io[0x19] = val; break; case Z180_ASTC0L: Z180.io[0x1a] = val; break; case Z180_ASTC0H: Z180.io[0x1b] = val; break; case Z180_ASTC1L: Z180.io[0x1c] = val; break; case Z180_ASTC1H: Z180.io[0x1d] = val; break; case Z180_CMR: Z180.io[0x1e] = val; break; case Z180_CCR: Z180.io[0x1f] = val; break; case Z180_SAR0L: Z180.io[0x20] = val; break; case Z180_SAR0H: Z180.io[0x21] = val; break; case Z180_SAR0B: Z180.io[0x22] = val; break; case Z180_DAR0L: Z180.io[0x23] = val; break; case Z180_DAR0H: Z180.io[0x24] = val; break; case Z180_DAR0B: Z180.io[0x25] = val; break; case Z180_BCR0L: Z180.io[0x26] = val; break; case Z180_BCR0H: Z180.io[0x27] = val; break; case Z180_MAR1L: Z180.io[0x28] = val; break; case Z180_MAR1H: Z180.io[0x29] = val; break; case Z180_MAR1B: Z180.io[0x2a] = val; break; case Z180_IAR1L: Z180.io[0x2b] = val; break; case Z180_IAR1H: Z180.io[0x2c] = val; break; case Z180_IAR1B: Z180.io[0x2d] = val; break; case Z180_BCR1L: Z180.io[0x2e] = val; break; case Z180_BCR1H: Z180.io[0x2f] = val; break; case Z180_DSTAT: Z180.io[0x30] = val; break; case Z180_DMODE: Z180.io[0x31] = val; break; case Z180_DCNTL: Z180.io[0x32] = val; break; case Z180_IL: Z180.io[0x33] = val; break; case Z180_ITC: Z180.io[0x34] = val; break; case Z180_IO35: Z180.io[0x35] = val; break; case Z180_RCR: Z180.io[0x36] = val; break; case Z180_IO37: Z180.io[0x37] = val; break; case Z180_CBR: Z180.io[0x38] = val; z180_mmu(); break; case Z180_BBR: Z180.io[0x39] = val; z180_mmu(); break; case Z180_CBAR: Z180.io[0x3a] = val; z180_mmu(); break; case Z180_IO3B: Z180.io[0x3b] = val; break; case Z180_IO3C: Z180.io[0x3c] = val; break; case Z180_IO3D: Z180.io[0x3d] = val; break; case Z180_OMCR: Z180.io[0x3e] = val; break; case Z180_IOCR: Z180.io[0x3f] = val; break; case Z180_IOLINES: z180_write_iolines(val); break; default: if( regnum <= REG_SP_CONTENTS ) { unsigned offset = _SPD + 2 * (REG_SP_CONTENTS - regnum); if( offset < 0xffff ) { WM( offset, val & 0xff ); WM( offset+1, (val >> 8) & 0xff ); } } } } READ_HANDLER( z180_internal_r ) { return Z180.io[offset & 0x3f]; } WRITE_HANDLER( z180_internal_w ) { z180_set_reg( Z180_CNTLA0 + (offset & 0x3f), data ); } /**************************************************************************** * Set IRQ line state ****************************************************************************/ void z180_set_irq_line(int irqline, int state) { if (irqline == IRQ_LINE_NMI) { if( Z180.nmi_state == state ) return; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d set_irq_line (NMI) %d\n", cpu_getactivecpu(), state); Z180.nmi_state = state; if( state == CLEAR_LINE ) return; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d take NMI\n", cpu_getactivecpu()); _PPC = -1; /* there isn't a valid previous program counter */ LEAVE_HALT; /* Check if processor was halted */ /* disable DMA transfers!! */ IO_DSTAT &= ~Z180_DSTAT_DME; _IFF1 = 0; PUSH( PC ); _PCD = 0x0066; Z180.extra_cycles += 11; } else { log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d set_irq_line %d\n",cpu_getactivecpu(), state); Z180.irq_state[irqline] = state; if( state == CLEAR_LINE ) return; if( irqline == 0 && Z180.irq_max ) { int daisychain, device, int_state; daisychain = (*Z180.irq_callback)(irqline); device = daisychain >> 8; int_state = daisychain & 0xff; log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d daisy chain $%04x -> device %d, state $%02x",cpu_getactivecpu(), daisychain, device, int_state); if( Z180.int_state[device]!= int_state ) { log_cb(RETRO_LOG_DEBUG, LOGPRE " change\n"); /* set new interrupt status */ Z180.int_state[device] = int_state; /* check interrupt status */ Z180.request_irq = Z180.service_irq = -1; /* search higher IRQ or IEO */ for( device = 0 ; device < Z180.irq_max ; device ++ ) { /* IEO = disable? */ if( Z180.int_state[device] & Z80_INT_IEO ) { Z180.request_irq = -1; /* if IEO is disable, masking lower IRQ */ Z180.service_irq = device; /* set highest interrupt service device */ } /* IRQ = request? */ if( Z180.int_state[device] & Z80_INT_REQ ) Z180.request_irq = device; } log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d daisy chain service_irq $%02x, request_irq $%02x\n", cpu_getactivecpu(), Z180.service_irq, Z180.request_irq); if( Z180.request_irq < 0 ) return; } else { log_cb(RETRO_LOG_DEBUG, LOGPRE " no change\n"); return; } } take_interrupt(irqline); } } /**************************************************************************** * Set IRQ vector callback ****************************************************************************/ void z180_set_irq_callback(int (*callback)(int)) { log_cb(RETRO_LOG_DEBUG, LOGPRE "Z180 #%d set_irq_callback $%08x\n",cpu_getactivecpu(), (int)callback); Z180.irq_callback = callback; } /**************************************************************************** * Return a formatted string for a register ****************************************************************************/ const char *z180_info(void *context, int regnum) { static char buffer[32][47+1]; static int which = 0; Z180_Regs *r = context; which = (which+1) % 32; buffer[which][0] = '\0'; if(!context ) r = &Z180; switch( regnum ) { case CPU_INFO_REG+Z180_PC: sprintf(buffer[which], "PC:%04X", r->PC.w.l); break; case CPU_INFO_REG+Z180_SP: sprintf(buffer[which], "SP:%04X", r->SP.w.l); break; case CPU_INFO_REG+Z180_AF: sprintf(buffer[which], "AF:%04X", r->AF.w.l); break; case CPU_INFO_REG+Z180_BC: sprintf(buffer[which], "BC:%04X", r->BC.w.l); break; case CPU_INFO_REG+Z180_DE: sprintf(buffer[which], "DE:%04X", r->DE.w.l); break; case CPU_INFO_REG+Z180_HL: sprintf(buffer[which], "HL:%04X", r->HL.w.l); break; case CPU_INFO_REG+Z180_IX: sprintf(buffer[which], "IX:%04X", r->IX.w.l); break; case CPU_INFO_REG+Z180_IY: sprintf(buffer[which], "IY:%04X", r->IY.w.l); break; case CPU_INFO_REG+Z180_R: sprintf(buffer[which], "R :%02X", (r->R & 0x7f) | (r->R2 & 0x80)); break; case CPU_INFO_REG+Z180_I: sprintf(buffer[which], "I :%02X", r->I); break; case CPU_INFO_REG+Z180_IL: sprintf(buffer[which], "IL :%02X", r->io[Z180_IL-Z180_CNTLA0]); break; case CPU_INFO_REG+Z180_AF2: sprintf(buffer[which], "AF'%04X", r->AF2.w.l); break; case CPU_INFO_REG+Z180_BC2: sprintf(buffer[which], "BC'%04X", r->BC2.w.l); break; case CPU_INFO_REG+Z180_DE2: sprintf(buffer[which], "DE'%04X", r->DE2.w.l); break; case CPU_INFO_REG+Z180_HL2: sprintf(buffer[which], "HL'%04X", r->HL2.w.l); break; case CPU_INFO_REG+Z180_IM: sprintf(buffer[which], "IM :%X", r->IM); break; case CPU_INFO_REG+Z180_IFF1: sprintf(buffer[which], "IFF1:%X", r->IFF1); break; case CPU_INFO_REG+Z180_IFF2: sprintf(buffer[which], "IFF2:%X", r->IFF2); break; case CPU_INFO_REG+Z180_HALT: sprintf(buffer[which], "HALT:%X", r->HALT); break; case CPU_INFO_REG+Z180_INT0_STATE: sprintf(buffer[which], "INT0:%X", r->irq_state[0]); break; case CPU_INFO_REG+Z180_INT1_STATE: sprintf(buffer[which], "INT1:%X", r->irq_state[1]); break; case CPU_INFO_REG+Z180_INT2_STATE: sprintf(buffer[which], "INT2:%X", r->irq_state[2]); break; case CPU_INFO_REG+Z180_DC0: if(Z180.irq_max >= 1) sprintf(buffer[which], "DC0:%X", r->int_state[0]); break; case CPU_INFO_REG+Z180_DC1: if(Z180.irq_max >= 2) sprintf(buffer[which], "DC1:%X", r->int_state[1]); break; case CPU_INFO_REG+Z180_DC2: if(Z180.irq_max >= 3) sprintf(buffer[which], "DC2:%X", r->int_state[2]); break; case CPU_INFO_REG+Z180_DC3: if(Z180.irq_max >= 4) sprintf(buffer[which], "DC3:%X", r->int_state[3]); break; case CPU_INFO_REG+Z180_CCR: sprintf(buffer[which], "CCR :%02X", r->io[Z180_CCR-Z180_CNTLA0]); break; case CPU_INFO_REG+Z180_ITC: sprintf(buffer[which], "ITC :%02X", r->io[Z180_ITC-Z180_CNTLA0]); break; case CPU_INFO_REG+Z180_CBR: sprintf(buffer[which], "CBR :%02X", r->io[Z180_CBR-Z180_CNTLA0]); break; case CPU_INFO_REG+Z180_BBR: sprintf(buffer[which], "BBR :%02X", r->io[Z180_BBR-Z180_CNTLA0]); break; case CPU_INFO_REG+Z180_CBAR: sprintf(buffer[which], "CBAR:%02X", r->io[Z180_CBAR-Z180_CNTLA0]); break; case CPU_INFO_REG+Z180_OMCR: sprintf(buffer[which], "OMCR:%02X", r->io[Z180_OMCR-Z180_CNTLA0]); break; case CPU_INFO_REG+Z180_IOCR: sprintf(buffer[which], "IOCR:%02X", r->io[Z180_IOCR-Z180_CNTLA0]); break; case CPU_INFO_FLAGS: sprintf(buffer[which], "%c%c%c%c%c%c%c%c", r->AF.b.l & 0x80? 'S':'.', r->AF.b.l & 0x40? 'Z':'.', r->AF.b.l & 0x20? '5':'.', r->AF.b.l & 0x10? 'H':'.', r->AF.b.l & 0x08? '3':'.', r->AF.b.l & 0x04? 'P':'.', r->AF.b.l & 0x02? 'N':'.', r->AF.b.l & 0x01? 'C':'.'); break; case CPU_INFO_NAME: return "Z180"; case CPU_INFO_FAMILY: return "Zilog Z8x180"; case CPU_INFO_VERSION: return "0.2"; case CPU_INFO_FILE: return __FILE__; case CPU_INFO_CREDITS: return "Copyright (C) 2000 <NAME>, all rights reserved."; case CPU_INFO_REG_LAYOUT: return (const char *)z180_reg_layout; case CPU_INFO_WIN_LAYOUT: return (const char *)z180_win_layout; } return buffer[which]; } unsigned z180_dasm( char *buffer, unsigned pc ) { #ifdef MAME_DEBUG return DasmZ180( buffer, pc ); #else sprintf( buffer, "$%02X", cpu_readop(pc) ); return 1; #endif } ======================= File: src/drivers/metlclsh.c ======================= <reponame>ToadKing/mame2003-plus-libretro /*************************************************************************** -= Metal Clash =- driver by <NAME>, based on brkthru.c by <NAME> CPUs : 2 x 6809 Sound : YM2203 + YM3526 Video : TC15G008AP + TC15G032CY (TOSHIBA) --------------------------------------------------------------------------- Year + Game Boards --------------------------------------------------------------------------- 85 Metal Clash DE-0212-1 & DE-0213-1 --------------------------------------------------------------------------- Notes: - Similar hardware to that in brkthru.c - Screenshots here: www.ne.jp/asahi/cc-sakura/akkun/bekkan/metal.html To Do: metlclsh: - Clocks are all unknown - Text on the title screen has wrong colors the first time around (unitialized foreground palette 1, will be initialized shortly) - The background tilemap ram is bankswitched with other (not understood) ram - There are a few unknown writes ***************************************************************************/ #include "driver.h" #include "vidhrdw/generic.h" #include "cpu/m6809/m6809.h" /* Variables defined in vidhrdw: */ extern data8_t *metlclsh_bgram, *metlclsh_fgram, *metlclsh_scrollx; /* Functions defined in vidhrdw: */ WRITE_HANDLER( metlclsh_bgram_w ); WRITE_HANDLER( metlclsh_fgram_w ); WRITE_HANDLER( metlclsh_gfxbank_w ); WRITE_HANDLER( metlclsh_rambank_w ); VIDEO_START( metlclsh ); VIDEO_UPDATE( metlclsh ); /*************************************************************************** Memory Maps - CPU #1 ***************************************************************************/ static data8_t *sharedram; static READ_HANDLER ( sharedram_r ) { return sharedram[offset]; } static WRITE_HANDLER( sharedram_w ) { sharedram[offset] = data; } static WRITE_HANDLER( metlclsh_cause_irq ) { cpu_set_irq_line(1,M6809_IRQ_LINE,ASSERT_LINE); } static WRITE_HANDLER( metlclsh_ack_nmi ) { cpu_set_irq_line(0,IRQ_LINE_NMI,CLEAR_LINE); } static MEMORY_READ_START( metlclsh_readmem ) { 0x0000, 0x7fff, MRA_ROM }, { 0x8000, 0x9fff, sharedram_r }, { 0xa000, 0xbfff, MRA_ROM }, { 0xc000, 0xc000, input_port_0_r }, { 0xc001, 0xc001, input_port_1_r }, { 0xc002, 0xc002, input_port_2_r }, { 0xc003, 0xc003, input_port_3_r }, /* { 0xc800, 0xc82f, MRA_RAM }, */ /* not actually read*/ /* { 0xcc00, 0xcc2f, MRA_RAM }, */ /* ""*/ { 0xd000, 0xd000, YM2203_status_port_0_r }, /* { 0xd800, 0xdfff, MRA_RAM }, */ /* not actually read*/ { 0xe800, 0xe9ff, MRA_RAM }, { 0xfff0, 0xffff, MRA_ROM }, /* Reset/IRQ vectors*/ MEMORY_END static MEMORY_WRITE_START( metlclsh_writemem ) { 0x0000, 0x7fff, MWA_ROM }, { 0x8000, 0x9fff, sharedram_w, &sharedram }, { 0xa000, 0xbfff, MWA_ROM }, { 0xc080, 0xc080, MWA_NOP }, /*? 0*/ { 0xc0c2, 0xc0c2, metlclsh_cause_irq }, /* cause irq on cpu #2*/ { 0xc0c3, 0xc0c3, metlclsh_ack_nmi }, /* nmi ack*/ { 0xc800, 0xc82f, paletteram_xxxxBBBBGGGGRRRR_split1_w, &paletteram }, { 0xcc00, 0xcc2f, paletteram_xxxxBBBBGGGGRRRR_split2_w, &paletteram_2 }, { 0xd000, 0xd000, YM2203_control_port_0_w }, { 0xd001, 0xd001, YM2203_write_port_0_w }, { 0xe000, 0xe000, YM3526_control_port_0_w }, { 0xe001, 0xe001, YM3526_write_port_0_w }, { 0xe800, 0xe9ff, MWA_RAM, &spriteram, &spriteram_size }, { 0xd800, 0xdfff, metlclsh_fgram_w, &metlclsh_fgram }, { 0xfff0, 0xffff, MWA_ROM }, MEMORY_END /*************************************************************************** Memory Maps - CPU #2 ***************************************************************************/ static WRITE_HANDLER( metlclsh_cause_nmi2 ) { cpu_set_irq_line(0,IRQ_LINE_NMI,ASSERT_LINE); } static WRITE_HANDLER( metlclsh_ack_irq2 ) { cpu_set_irq_line(1,M6809_IRQ_LINE,CLEAR_LINE); } static WRITE_HANDLER( metlclsh_ack_nmi2 ) { cpu_set_irq_line(1,IRQ_LINE_NMI,CLEAR_LINE); } static WRITE_HANDLER( metlclsh_flipscreen_w ) { flip_screen_set(data & 1); } static MEMORY_READ_START( metlclsh_readmem2 ) { 0x0000, 0x7fff, MRA_ROM }, { 0x8000, 0x9fff, sharedram_r }, { 0xc000, 0xc000, input_port_0_r }, { 0xc001, 0xc001, input_port_1_r }, { 0xc002, 0xc002, input_port_2_r }, { 0xc003, 0xc003, input_port_3_r }, { 0xd000, 0xd7ff, MRA_BANK1 }, { 0xfff0, 0xffff, MRA_ROM }, /* Reset/IRQ vectors*/ MEMORY_END static MEMORY_WRITE_START( metlclsh_writemem2 ) { 0x0000, 0x7fff, MWA_ROM }, { 0x8000, 0x9fff, sharedram_w }, { 0xc000, 0xc000, metlclsh_gfxbank_w }, /* bg tiles bank*/ { 0xc0c0, 0xc0c0, metlclsh_cause_nmi2 }, /* cause nmi on cpu #1*/ { 0xc0c1, 0xc0c1, metlclsh_ack_irq2 }, /* irq ack*/ { 0xd000, 0xd7ff, metlclsh_bgram_w, &metlclsh_bgram }, /* this is banked*/ { 0xe417, 0xe417, metlclsh_ack_nmi2 }, /* nmi ack*/ { 0xe301, 0xe301, metlclsh_flipscreen_w }, /* 0/1*/ { 0xe401, 0xe401, metlclsh_rambank_w }, { 0xe402, 0xe403, MWA_RAM, &metlclsh_scrollx }, /* { 0xe404, 0xe404, MWA_NOP }, */ /*? 0*/ /* { 0xe410, 0xe410, MWA_NOP }, */ /*? 0 on startup only*/ { 0xfff0, 0xffff, MWA_ROM }, MEMORY_END /*************************************************************************** Input Ports ***************************************************************************/ INPUT_PORTS_START( metlclsh ) PORT_START /* IN0 - c000 */ PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x01, DEF_STR( 1C_3C ) ) PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x20, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_BITX( 0x40, 0x40, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Infinite Energy", IP_KEY_NONE, IP_JOY_NONE ) PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_BITX( 0x80, 0x80, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Infinite Lives", IP_KEY_NONE, IP_JOY_NONE ) PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START /* IN1 - c001 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) PORT_START /* IN2 - c002 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_COCKTAIL ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_COCKTAIL ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_COCKTAIL ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_COCKTAIL ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL ) PORT_BIT_IMPULSE( 0x40, IP_ACTIVE_LOW, IPT_COIN1, 1 ) PORT_BIT_IMPULSE( 0x80, IP_ACTIVE_LOW, IPT_COIN2, 1 ) PORT_START /* IN3 - c003 */ PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) ) PORT_DIPSETTING( 0x00, "2" ) PORT_DIPSETTING( 0x01, "3" ) PORT_DIPNAME( 0x02, 0x02, "Enemies Speed" ) PORT_DIPSETTING( 0x02, "Low" ) PORT_DIPSETTING( 0x00, "High" ) PORT_DIPNAME( 0x04, 0x04, "Enemies Energy" ) PORT_DIPSETTING( 0x04, "Low" ) PORT_DIPSETTING( 0x00, "High" ) PORT_DIPNAME( 0x08, 0x08, "Time" ) PORT_DIPSETTING( 0x00, "75" ) PORT_DIPSETTING( 0x08, "90" ) PORT_DIPNAME( 0x10, 0x10, DEF_STR( Flip_Screen ) ) PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* cpu2 will clr c040 on startup forever*/ PORT_BIT_IMPULSE( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1, 1 ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) INPUT_PORTS_END /*************************************************************************** Graphics Layouts ***************************************************************************/ static struct GfxLayout spritelayout = { 16,16, RGN_FRAC(1,3), 3, { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) }, { STEP8(8*8*2,1), STEP8(8*8*0,1) }, { STEP8(8*8*0,8), STEP8(8*8*1,8) }, 16*16 }; static struct GfxLayout tilelayout16 = { 16,16, RGN_FRAC(1,4), 3, { RGN_FRAC(2,4), RGN_FRAC(1,4), RGN_FRAC(0,4) }, { STEP8(8*8*0+7,-1), STEP8(8*8*2+7,-1) }, { STEP8(8*8*0,8), STEP8(8*8*1,8) }, 16*16 }; static struct GfxLayout tilelayout8 = { 8,8, RGN_FRAC(1,2), 2, { 0, 4 }, { STEP4(RGN_FRAC(1,2),1), STEP4(0,1) }, { STEP8(0,8) }, 8*8 }; static struct GfxDecodeInfo metlclsh_gfxdecodeinfo[] = { { REGION_GFX1, 0, &spritelayout, 0x00, 2 }, /* [0] Sprites*/ { REGION_GFX2, 0, &tilelayout16, 0x10, 1 }, /* [1] Background*/ { REGION_GFX3, 0, &tilelayout8, 0x20, 4 }, /* [2] Foreground*/ { -1 } }; /*************************************************************************** Machine Drivers ***************************************************************************/ static void metlclsh_irqhandler(int linestate) { cpu_set_irq_line(0,M6809_IRQ_LINE,linestate); } static struct YM2203interface metlclsh_ym2203_interface = { 1, 1500000, /*?*/ { YM2203_VOL(50,10) }, { 0 }, { 0 }, { 0 }, { 0 } }; static struct YM3526interface metlclsh_ym3526_interface = { 1, 3000000, /*?*/ { 50 }, { metlclsh_irqhandler }, }; INTERRUPT_GEN( metlclsh_interrupt2 ) { if (cpu_getiloops() == 0) return; /* generate NMI on coin insertion */ if ((~readinputport(2) & 0xc0) || (~readinputport(3) & 0x40)) cpu_set_nmi_line(1, ASSERT_LINE); } static MACHINE_INIT( metlclsh ) { flip_screen_set(0); } static MACHINE_DRIVER_START( metlclsh ) /* basic machine hardware */ MDRV_CPU_ADD(M6809, 1500000) /*?*/ MDRV_CPU_MEMORY(metlclsh_readmem, metlclsh_writemem) /* IRQ by YM3526, NMI by cpu #2*/ MDRV_CPU_ADD(M6809, 1500000) /*?*/ MDRV_CPU_MEMORY(metlclsh_readmem2, metlclsh_writemem2) MDRV_CPU_VBLANK_INT(metlclsh_interrupt2,2) /* IRQ by cpu #1, NMI by coins insertion*/ MDRV_FRAMES_PER_SECOND(58) MDRV_VBLANK_DURATION(DEFAULT_REAL_60HZ_VBLANK_DURATION) /* we're using IPT_VBLANK*/ MDRV_MACHINE_INIT(metlclsh) /* video hardware */ MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER) MDRV_SCREEN_SIZE(32*8, 32*8) MDRV_VISIBLE_AREA(0*8, 32*8-1, 1*8, 30*8-1) MDRV_GFXDECODE(metlclsh_gfxdecodeinfo) MDRV_PALETTE_LENGTH(3 * 16) MDRV_VIDEO_START(metlclsh) MDRV_VIDEO_UPDATE(metlclsh) /* sound hardware */ MDRV_SOUND_ADD(YM2203, metlclsh_ym2203_interface) MDRV_SOUND_ADD(YM3526, metlclsh_ym3526_interface) MACHINE_DRIVER_END /*************************************************************************** ROMs Loading ***************************************************************************/ /*************************************************************************** METAL CLASH[DATA EAST] JAPAN (c)1985 ROM Type:2764,27256 Name Size Location -------------------------------- CS00.BIN 2764 C11 cpu CS01.BIN 27256 C12 cpu CS02.BIN 27256 C14 cpu CS03.BIN 27256 C15 cpu CS04.BIN 27256 C17 cpu CS05.BIN 27256 H7 sound CS06.BIN 27256 D9 Video CS07.BIN 27256 D10 Video CS08.BIN 27256 D12 Video TTL-PROM 82S123(Color Table,8bit x 32Byte). 0000:3A 78 79 71 75 74 76 32 0008:3A 3D 29 21 25 14 16 12 0010:00 00 00 00 00 00 00 00 0018:00 00 00 00 00 00 00 00 This ROM work at DE-0212-1 & DE-0213-1 cpu :6809(MAIN),6809(SOUND) sound :YM2203,YM3526 custom:TC15G008AP,TC15G032CY(TOSHIBA) color :82S123 DIP-SW SW1 1 Coin CHARGE SELECT 1 2 Coin CHARGE SELECT 1 3 Coin CHARGE SELECT 2 4 Coin CHARGE SELECT 2 5 DON't CHANGE(for SERVICE??) 6 ATTRACT SOUND 7 My ROBOT Infinity 8 My ROBOT LEFT not Decriment SW2 1 My ROBOT LEFT 2/3 2 EMENY SPEED EASY/DIFFICULT 3 EMENY ENERGY EASY/DIFFICULT 4 TIME LONG/DIFFICULT 5 SCREEN CHANGE NORMAL/FLIP 6 none?? 7 none?? 8 DON't CHANGE(for SERVICE??) "DARWIN 4078" use TC15G032CY too. ***************************************************************************/ ROM_START( metlclsh ) ROM_REGION( 0x10000, REGION_CPU1, 0 ) ROM_LOAD( "cs04.bin", 0x00000, 0x8000, CRC(c2cc79a6) SHA1(0f586d4145afabbb45ea4865ed7a6590b14a2ab0) ) ROM_LOAD( "cs00.bin", 0x0a000, 0x2000, CRC(af0f2998) SHA1(09dd2516406168660d5cd3a36be1e5f0adbcdb8a) ) ROM_COPY( REGION_CPU1, 0x7ff0, 0xfff0, 0x10 ) ROM_REGION( 0x10000, REGION_CPU2, 0 ) ROM_LOAD( "cs03.bin", 0x00000, 0x8000, CRC(51c4720c) SHA1(7fd93bdcf029e7d2509b73b32f61fddf85f3453f) ) ROM_COPY( REGION_CPU2, 0x7ff0, 0xfff0, 0x10 ) ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE ) /* Sprites*/ ROM_LOAD( "cs06.bin", 0x00000, 0x8000, CRC(9f61403f) SHA1(0ebb1cb9d4983746b6b32ec948e7b9efd90783d1) ) ROM_LOAD( "cs07.bin", 0x08000, 0x8000, CRC(d0610ea5) SHA1(3dfa16cbe93a4c08993111f78a8dd22c874fdd28) ) ROM_LOAD( "cs08.bin", 0x10000, 0x8000, CRC(a8b02125) SHA1(145a22b2910b2fbfb28925f58968ee2bdeae1dda) ) ROM_REGION( 0x10000, REGION_GFX2, ROMREGION_DISPOSE ) /* Background*/ ROM_LOAD( "cs01.bin", 0x00000, 0x1000, CRC(9c72343d) SHA1(c5618be7874ab6c930b0e68935c93f1958a1916d) ) ROM_CONTINUE( 0x04000, 0x1000 ) ROM_CONTINUE( 0x08000, 0x1000 ) ROM_CONTINUE( 0x0c000, 0x1000 ) ROM_CONTINUE( 0x01000, 0x1000 ) ROM_CONTINUE( 0x05000, 0x1000 ) ROM_CONTINUE( 0x09000, 0x1000 ) ROM_CONTINUE( 0x0d000, 0x1000 ) ROM_LOAD( "cs02.bin", 0x02000, 0x1000, CRC(3674673e) SHA1(8ba8864cefcb79afe5fe6821005a9d19742756e9) ) ROM_CONTINUE( 0x06000, 0x1000 ) ROM_CONTINUE( 0x0a000, 0x1000 ) ROM_CONTINUE( 0x0e000, 0x1000 ) ROM_CONTINUE( 0x03000, 0x1000 ) ROM_CONTINUE( 0x07000, 0x1000 ) ROM_CONTINUE( 0x0b000, 0x1000 ) ROM_CONTINUE( 0x0f000, 0x1000 ) ROM_REGION( 0x04000, REGION_GFX3, ROMREGION_DISPOSE ) /* Foreground*/ ROM_LOAD( "cs05.bin", 0x00000, 0x4000, CRC(f90c9c6b) SHA1(ca8e497e9c388078343dd1303beef6ee38748d6a) ) ROM_CONTINUE( 0x00000, 0x4000 ) /* first half is empty*/ ROM_REGION( 0x020, REGION_PROMS, 0 ) /*?*/ ROM_LOAD( "82s123.prm", 0x0000, 0x20, CRC(6844cc88) SHA1(89d23367aa6ff541205416e82781fe938dfeeb52) ) ROM_END GAME( 1985, metlclsh, 0, metlclsh, metlclsh, 0, ROT0, "Data East", "Metal Clash (Japan)" ) ======================= File: src/machine/bigevglf_machine.c ======================= <filename>src/machine/bigevglf_machine.c /*************************************************************************** machine.c Functions to emulate general aspects of the machine (RAM, ROM, interrupts, I/O ports) ***************************************************************************/ #include "driver.h" static unsigned char from_mcu; static int mcu_sent = 0,main_sent = 0; static unsigned char portA_in,portA_out,ddrA; static unsigned char portB_in,portB_out,ddrB; static unsigned char portC_in,portC_out,ddrC; READ_HANDLER( bigevglf_68705_portA_r ) { return (portA_out & ddrA) | (portA_in & ~ddrA); } WRITE_HANDLER( bigevglf_68705_portA_w ) { portA_out = data; } WRITE_HANDLER( bigevglf_68705_ddrA_w ) { ddrA = data; } READ_HANDLER( bigevglf_68705_portB_r ) { return (portB_out & ddrB) | (portB_in & ~ddrB); } WRITE_HANDLER( bigevglf_68705_portB_w ) { if ((ddrB & 0x02) && (~portB_out & 0x02) && (data & 0x02)) /* positive going transition of the clock */ { cpu_set_irq_line(3,0,CLEAR_LINE); main_sent = 0; } if ((ddrB & 0x04) && (~portB_out & 0x04) && (data & 0x04) ) /* positive going transition of the clock */ { from_mcu = portA_out; mcu_sent = 0; } portB_out = data; } WRITE_HANDLER( bigevglf_68705_ddrB_w ) { ddrB = data; } READ_HANDLER( bigevglf_68705_portC_r ) { portC_in = 0; if (main_sent) portC_in |= 0x01; if (mcu_sent) portC_in |= 0x02; return (portC_out & ddrC) | (portC_in & ~ddrC); } WRITE_HANDLER( bigevglf_68705_portC_w ) { portC_out = data; } WRITE_HANDLER( bigevglf_68705_ddrC_w ) { ddrC = data; } WRITE_HANDLER( bigevglf_mcu_w ) { portA_in = data; main_sent = 1; cpu_set_irq_line(3,0,ASSERT_LINE); } READ_HANDLER( bigevglf_mcu_r ) { mcu_sent = 1; return from_mcu; } READ_HANDLER( bigevglf_mcu_status_r ) { int res = 0; if (!main_sent) res |= 0x08; if (!mcu_sent) res |= 0x10; return res; } ======================= File: src/cpu/tms9900/9900stat.h ======================= <filename>src/cpu/tms9900/9900stat.h /************************************************************************ ST register functions ************************************************************************/ /* remember that P bit is maintained in lastparity */ /* setstat sets the ST_P bit according to lastparity It must be called before reading the ST register. */ void setstat(void) { int i; UINT8 a; I.STATUS &= ~ ST_P; /* We set the parity bit. */ a = lastparity; for (i=0; i<8; i++) /* 8 bits to test */ { if (a & 1) /* If current bit is set */ I.STATUS ^= ST_P; /* we change ST_P bit */ a >>= 1; /* Next bit. */ } } /* getstat sets emulator's lastparity variable according to 9900's STATUS bits. It must be called on interrupt return, or when, for some reason, the emulated program sets the STATUS register directly. */ void getstat(void) { if (I.STATUS & ST_P) lastparity = 1; else lastparity = 0; } /* A few words about the following functions. A big portability issue is the behavior of the ">>" instruction with the sign bit, which has not been normalised. Every compiler does whatever it thinks smartest. My code assumed that when shifting right signed numbers, the operand is left-filled with a copy of sign bit, and that when shifting unsigned variables, it is left-filled with 0s. This is probably the most logical behaviour, and it is the behavior of CW PRO3 - most time (the exception is that ">>=" instructions always copy the sign bit (!)). But some compilers are bound to disagree. So, I had to create special functions with predefined tables included, so that this code work on every compiler. BUT this is a real slow-down. So, you might have to include a few lines in assembly to make this work better. Sorry about this, this problem is really unpleasant and absurd, but it is not my fault. */ static const UINT16 right_shift_mask_table[17] = { 0xFFFF, 0x7FFF, 0x3FFF, 0x1FFF, 0x0FFF, 0x07FF, 0x03FF, 0x01FF, 0x00FF, 0x007F, 0x003F, 0x001F, 0x000F, 0x0007, 0x0003, 0x0001, 0x0000 }; static const UINT16 inverted_right_shift_mask_table[17] = { 0x0000, 0x8000, 0xC000, 0xE000, 0xF000, 0xF800, 0xFC00, 0xFE00, 0xFF00, 0xFF80, 0xFFC0, 0xFFE0, 0xFFF0, 0xFFF8, 0xFFFC, 0xFFFE, 0xFFFF }; static INLINE UINT16 logical_right_shift(UINT16 val, int c) { return((val>>c) & right_shift_mask_table[c]); } static INLINE INT16 arithmetic_right_shift(INT16 val, int c) { if (val < 0) return((val>>c) | inverted_right_shift_mask_table[c]); else return((val>>c) & right_shift_mask_table[c]); } /* Set lae */ static INLINE void setst_lae(INT16 val) { I.STATUS &= ~ (ST_L | ST_A | ST_E); if (val > 0) I.STATUS |= (ST_L | ST_A); else if (val < 0) I.STATUS |= ST_L; else I.STATUS |= ST_E; } /* Set laep (BYTE) */ static INLINE void setst_byte_laep(INT8 val) { I.STATUS &= ~ (ST_L | ST_A | ST_E); if (val > 0) I.STATUS |= (ST_L | ST_A); else if (val < 0) I.STATUS |= ST_L; else I.STATUS |= ST_E; lastparity = val; } /* For COC, CZC, and TB */ static INLINE void setst_e(UINT16 val, UINT16 to) { if (val == to) I.STATUS |= ST_E; else I.STATUS &= ~ ST_E; } /* For CI, C, CB */ static INLINE void setst_c_lae(UINT16 to, UINT16 val) { I.STATUS &= ~ (ST_L | ST_A | ST_E); if (val == to) I.STATUS |= ST_E; else { if ( ((INT16) val) > ((INT16) to) ) I.STATUS |= ST_A; if ( ((UINT16) val) > ((UINT16) to) ) I.STATUS |= ST_L; } } #define wadd(addr,expr) { int lval = setst_add_laeco(readword(addr), (expr)); writeword((addr),lval); } #define wsub(addr,expr) { int lval = setst_sub_laeco(readword(addr), (expr)); writeword((addr),lval); } #if defined(__POWERPC__) &&!defined(__GNUC__) /* setst_add_32_laeco :*/ /* - computes a+b*/ /* - sets L, A, E, Carry and Overflow in st*/ /**/ /* a -> r3, b -> r4, st -> r5*/ /* preserve r6-r12*/ static INT32 asm setst_add_32_laeco(register INT32 a, register INT32 b, register INT16 st) { addco. r3, b, a /* add, set CR0, and set CA and OV*/ clrlwi st, st, 21 /* clear L, A, E, C, O flags (-> keep bits 21-31)*/ mcrxr cr1 /* move XER (-> CA and CO bits) to CR1*/ beq- null_result /* if EQ is set, jump to null_result. No jump is more likely than a jump.*/ bgt+ positive_result /* if GT is set, jump to positive_result. A jump is more likely than no jump.*/ ori st, st, ST_L /* if result < 0, set ST_L*/ b next /* now set carry & overflow as needed*/ null_result: ori st, st, ST_E /* if result == 0, set ST_E*/ b next positive_result: ori st, st, ST_L | ST_A /* if result > 0, set ST_L and ST_A*/ next: bf+ cr1*4+2, nocarry /* if CA is not set, jump to nocarry. A jump is more likely than no jump.*/ ori st, st, ST_C /* else set ST_C*/ nocarry: bflr+ cr1*4+1 /* if OV is not set, return. A jump is more likely than no jump.*/ ori st, st, ST_O /* else set ST_O*/ blr /* return*/ } /* setst_sub_32_laeco :*/ /* - computes a-b*/ /* - sets L, A, E, Carry and Overflow in ST*/ /**/ /* a -> r3, b -> r4, st -> r5*/ /* preserve r6-r12*/ static INT32 asm setst_sub_32_laeco(register INT32 a, register INT32 b, register INT16 st) { subco. r3, a, b /* sub, set CR0, and set CA and OV*/ clrlwi st, st, 21 /* clear L, A, E, C, O flags (-> keep bits 21-31)*/ mcrxr cr1 /* move XER (-> CA and CO bits) to CR1*/ beq- null_result /* if EQ is set, jump to null_result. No jump is more likely than a jump.*/ bgt+ positive_result /* if GT is set, jump to positive_result. A jump is more likely than no jump.*/ ori st, st, ST_L /* if result < 0, set ST_L*/ b next /* now set carry & overflow as needed*/ null_result: ori st, st, ST_E /* if result == 0, set ST_E*/ b next positive_result: ori st, st, ST_L | ST_A /* if result > 0, set ST_L and ST_A*/ next: bf- cr1*4+2, nocarry /* if CA is not set, jump to nocarry. No jump is more likely than a jump.*/ ori st, st, ST_C /* else set ST_C*/ nocarry: bflr+ cr1*4+1 /* if OV is not set, return. A jump is more likely than no jump.*/ ori st, st, ST_O /* else set ST_O*/ blr /* return*/ } /**/ /* Set laeco for add*/ /**/ static INT16 asm setst_add_laeco(register INT16 a, register INT16 b) { /* a -> r3, b -> r4*/ lwz r6, I(RTOC)
74,599
thestackv1_concat_by_repo-long/65536-65536
apis-in-csharp-or-visual-basic.md) * [非同期を使用した非同期プログラミングと Await (c# および Visual Basic)](https://msdn.microsoft.com/library/hh191443(vs.110).aspx) * [リバーシ サンプル機能シナリオ: 非同期コード](https://msdn.microsoft.com/library/windows/apps/xaml/jj712233.aspx#async) ======================= File: windows-apps-src/debug-test-perf/planning-and-measuring-performance.md ======================= <gh_stars>1-10 --- ms.assetid: A37ADD4A-2187-4767-9C7D-EDE8A90AA215 title: パフォーマンスの計画 description: ユーザーは、高い応答性と自然な使用感、そしてバッテリーが消耗しないことをアプリに期待しています。 ms.date: 02/08/2017 ms.topic: article keywords: windows 10, uwp ms.localizationpriority: medium ms.openlocfilehash: 3bfe034ed697661c81b2f01b67fafeee1941832d ms.sourcegitcommit: b034650b684a767274d5d88746faeea373c8e34f ms.translationtype: MT ms.contentlocale: ja-JP ms.lasthandoff: 03/06/2019 ms.locfileid: "57640317" --- # <a name="planning-for-performance"></a>パフォーマンスの計画 ユーザーは、高い応答性と自然な使用感、そしてバッテリーが消耗しないことをアプリに期待しています。 技術的には、パフォーマンスは機能要件ではありませんが、パフォーマンスを機能として扱うことで、ユーザーの期待に沿うことができます。 鍵となる要因は、目標の明確化と測定の実施です。 パフォーマンスが重要なシナリオを決定し、優れたパフォーマンスとは何を意味するかを定義します。 次に、プロジェクトの初期とライフサイクル全体で十分な回数の測定を行って、目標を達成できることを確認します。 ## <a name="specifying-goals"></a>目標を明確にする ユーザー エクスペリエンスは、優れたパフォーマンスを定義する基本的な方法です。 アプリの起動時間は、アプリのパフォーマンスに対するユーザーの認識に影響を与える可能性があります。 ユーザーは、アプリの起動時間が 1 秒未満は優秀、5 秒未満は良好、5 秒を超えると貧弱であると考えることがあります。 その他のメトリック (メモリなど) がユーザー エクスペリエンスに与える影響はそれほど明確ではありません。 アプリが使うメモリの量が増えると、中断しているか非アクティブになっているアプリが終了する可能性が高くなります。 一般に、メモリの使用量が高くなるとシステム上のすべてのアプリのエクスペリエンスが低下するため、メモリの消費量に関する目標を設定することは妥当なことです。 ユーザーが認識するアプリの大まかなサイズ (大、中、小) を考慮します。 パフォーマンスに関する期待は、この認識と関連性があります。 たとえば、たくさんのメディアは使わない小さいアプリであれば、消費するメモリが 100 MB を超えないようにします。 初期目標を設定して後で修正するほうが、目標をまったく持たないことよりもましです。 アプリのパフォーマンス目標は具体的かつ測定可能である必要があり、ユーザーまたはアプリがタスクを完了させるまでにかかる時間 (時間)、ユーザーの操作に応えてアプリが自身を再描画する割合と継続性 (滑らかな動作)、アプリがバッテリー電源を含むシステム リソースを節約する度合い (効率性) という 3 つのカテゴリに分類する必要があります。 ## <a name="time"></a>時間 ユーザーがアプリでタスクを完了するためにかかる経過時間の容認できる範囲 (*インタラクション クラス*) を考えます。 各インタラクション クラスに対して、ラベル、認識されるユーザーの感情、理想時間、および最大時間を割り当てます。 いくつかの提案を次に示します。 | インタラクション クラスのラベル | ユーザーの体感 | 理想時間 | 最大 | 例 | |-------------------------|---------------------------------|------------------|------------------|------------------------------------------------------------------------------| | ファースト (高速) | ほとんど遅延を感じない | 100 ミリ秒 | 200 ミリ秒 | アプリ バーを起動する、ボタンを押す (最初の応答) | | Typical (標準) | 速いが、高速ではない | 300 ミリ秒 | 500 ミリ秒 | サイズ変更、セマンティック ズーム | | Responsive (応答) | 速くはないが、反応はよい | 500 ミリ秒 | 1 秒 | 別のページに移動する、中断状態からアプリを再開する | | Launch | 操作に干渉する | 1 秒 | 3 秒 | アプリを初めて起動する、アプリを終了後にもう一度起動する | | 継続性 | 反応がよいと感じない | 500 ミリ秒 | 5 秒 | インターネットからファイルをダウンロードする | | Captive (占有) | 遅い、ユーザーが切り替えを検討する可能性がある | 500 ミリ秒 | 10 秒 | ストアから複数のアプリをインストールする |   これで、インタラクション クラスをアプリのパフォーマンスのシナリオに割り当てることができます。 各シナリオに、アプリを参照した時点、ユーザー エクスペリエンスの一部、およびインタラクション クラスを割り当てることができます。 次に示すのは、サンプルのレシピ紹介アプリのための提案です。 <!-- DHALE: used HTML table here b/c WDCML src used rowspans --> <table> <tr><th>シナリオ</th><th>時点</th><th>ユーザー エクスペリエンス</th><th>インタラクション クラス</th></tr> <tr><td rowspan="3">レシピ ページに移動する </td><td>最初の応答</td><td>ページの切り替えアニメーションが始まった</td><td>Fast (高速) (100 から 200 ミリ秒)</td></tr> <tr><td>Responsive (応答)</td><td>材料のリストが読み込まれた、画像は表示されていない</td><td>Responsive (応答) (500 ミリ秒から 1 秒)</td></tr> <tr><td>ページが表示された</td><td>すべてのコンテンツが読み込まれた、画像が表示された</td><td>Continuous (継続) (500 ミリ秒から 5 秒)</td></tr> <tr><td rowspan="2">レシピを検索する</td><td>最初の応答</td><td>検索ボタンをクリックした</td><td>Fast (高速) (100 から 200 ミリ秒)</td></tr> <tr><td>ページが表示された</td><td>ローカル レシピのタイトル一覧が表示された</td><td>Typical (標準) (300 から 500 ミリ秒)</td></tr> </table> ライブ コンテンツを表示する場合は、コンテンツの更新目標も考慮します。 目標は、コンテンツを数秒ごとに更新することですか。 それとも、数分ごと、数時間ごと、1 日に 1 回の更新で、ユーザー エクスペリエンスは許容できる範囲ですか。 目標を明確にすることで、アプリのテスト、分析、最適化を実行しやすくなります。 ## <a name="fluidity"></a>滑らかな動作 アプリの具体的で測定可能な滑らかな動作の目標には、以下が含まれます。 - 画面の再描画で中断 (エラー) が発生しない。 - アニメーションは 1 秒あたり 60 フレームでレンダリングする (FPS)。 - ユーザーがパンまたはスクロールしたとき、アプリは 1 秒あたり 3 ~ 6 ページ分のコンテンツを表示する。 ## <a name="efficiency"></a>効率性 アプリの具体的で測定可能な効率性の目標には、以下が含まれます。 - アプリのプロセスで、常に CPU の割合が *N* 以下であり、メモリ使用量 (MB 単位) が *M* 以下である。 - アプリがアクティブでないとき、*N* と *M* は、アプリのプロセスでは 0 である。 - アプリはバッテリー電源で *X* 時間アクティブに使用でき、アプリがアクティブでないとき、デバイスは充電状態を *Y* 時間保持する。 ## <a name="design-your-app-for-performance"></a>アプリのパフォーマンスを設計する パフォーマンスの目標を使って、アプリの設計に役立てることができます。 サンプルのレシピ紹介アプリで、ユーザーがレシピ ページに移動した後、レシピの名前が最初に表示され、少し遅れて材料が表示され、さらに遅れて画像が表示されるように、[項目を徐々に更新](optimize-gridview-and-listview.md#update-items-incrementally)します。 これで、パンまたはスクロール中の応答と滑らかな UI が保たれ、操作のペースが落ちて UI スレッドが追い付けるようになった後で完全なレンダリングを実行できます。 他にも次の局面を検討します。 **UI** - [XAML マークアップを最適化](optimize-xaml-loading.md)することで、アプリの UI の各ページ (特に最初のページ) の解析と読み込みの時間とメモリの効率を最大化します。 簡単に言うと、必要になるまで UI とコードの読み込みを遅らせます。 - [ **ListView**](https://msdn.microsoft.com/library/windows/apps/BR242878) と [**GridView**](https://msdn.microsoft.com/library/windows/apps/BR242705) では、すべての項目を同じサイズにし、できるだけ多くの [ListView と GridView の最適化手法](optimize-gridview-and-listview.md)を使います。 - UI は、コード内で命令を使って構築するのではなく、フレームワークが読み込んでチャンクで再利用できるマークアップ形式で宣言します。 - ユーザーが必要とするまで UI 要素の作成を遅らせます。 [ **x:Load**](../xaml-platform/x-load-attribute.md) 属性をご覧ください。 - ストーリーボードに設定されたアニメーションよりテーマ切り替えやテーマ アニメーションを優先的に使います。 詳しくは、「[アニメーションの概要](https://msdn.microsoft.com/library/windows/apps/Mt187350)」をご覧ください。 ストーリーボードに設定されたアニメーションでは、画面を定期的に更新して CPU とグラフィックス パイプラインを常にアクティブにしておく必要があることを忘れないようにします。 バッテリーを節約するために、ユーザーがアプリを操作していない場合はアニメーションを実行しないようにします。 - 読み込む画像は、[**GetThumbnailAsync**](https://msdn.microsoft.com/library/windows/apps/BR227210) メソッドを使って、そのときのビューに適したサイズで読み込む必要があります。 **CPU、メモリ、および電源** - 優先度の低い作業は、優先度の低いスレッドやコアで実行するようにスケジュールを設定します。 [非同期プログラミング](https://msdn.microsoft.com/library/windows/apps/Mt187335)、[**Dispatcher**](https://msdn.microsoft.com/library/windows/apps/BR209054) プロパティ、[**CoreDispatcher**](https://msdn.microsoft.com/library/windows/apps/BR208211) クラスをご覧ください。 - 一時停止中のメモリ使用量の多いリソース (メディアなど) を解放することで、アプリのメモリ使用量を最小限に抑えます。 - コードのワーキング セットを最小限に抑えます。 - イベント ハンドラーを登録解除し、UI 要素を逆参照して、できるだけメモリ リークを避けます。 - バッテリーを節約するために、データをポーリングする頻度、センサーを照会する頻度、またはアイドル状態の CPU に作業をスケジュールする頻度を控えめにします。 **データ アクセス** - 可能であれば、コンテンツをプリフェッチします。 自動的プリフェッチについては、[**ContentPrefetcher**](https://msdn.microsoft.com/library/windows/apps/Dn279042) クラスをご覧ください。 手動プリフェッチについては、[**Windows.ApplicationModel.Background**](https://msdn.microsoft.com/library/windows/apps/BR224847) 名前空間と [**MaintenanceTrigger**](https://msdn.microsoft.com/library/windows/apps/Hh700517) クラスをご覧ください。 - 可能であれば、アクセスするときに負荷がかかるコンテンツはキャッシュしておきます。 [ **LocalFolder**](https://msdn.microsoft.com/library/windows/apps/BR241621) プロパティと [**LocalSettings**](https://msdn.microsoft.com/library/windows/apps/BR241622) プロパティをご覧ください。 - キャッシュが失われた場合は、できるだけ早くプレース ホルダー UI を表示して、アプリがコンテンツを読み込み中であることを示します。 ユーザーに不快感を与えないような方法で、プレースホルダーからライブ コンテンツに切り替えます。 たとえば、アプリがライブ コンテンツを読み込む際に、ユーザーの指またはマウス ポインターの下にあるコンテンツの位置を変更しないようにします。 **アプリの起動と再開** - アプリのスプラッシュ画面の表示を遅らせ、必要ない場合は拡張しません。 詳しくは、「[高速で滑らかな起動エクスペリエンスを作り上げる](https://go.microsoft.com/fwlink/p/?LinkId=317595)」と「[スプラッシュ画面の表示時間の延長](https://msdn.microsoft.com/library/windows/apps/Mt187309)」をご覧ください。 - スプラッシュ画面が消えた直後に発生するアニメーションは無効にします。アプリの起動が遅くなるように感じられるためです。 **アダプティブ UI、および印刷の向き** - [ **VisualStateManager**](https://msdn.microsoft.com/library/windows/apps/BR209021) クラスを使います。 - 必要な処理だけをすぐに完了し、負荷の大きなアプリの作業は後回しにします。処理を完了し、アプリの UI がトリミングされた状態で表示されるまでに 200 ~ 800 ミリ秒かかります。 パフォーマンス関連の設計が整ったら、アプリのコーディングを始めることができます。 ## <a name="instrument-for-performance"></a>パフォーマンスを計測する アプリをコーディングする際に、アプリの実行中のある時点におけるメッセージやイベントをログに記録するコードを追加します。 アプリを後でテストする際に、Windows Performance Recorder や Windows Performance Analyzer (どちらも [Windows Performance Toolkit](https://msdn.microsoft.com/library/windows/apps/xaml/hh162945.aspx) に含まれています) などのプロファイリング ツールを使って、アプリのパフォーマンスに関するレポートを作成して閲覧できます。 このレポートでメッセージやイベントを確認して、レポートの結果を簡単に解析できます。 ユニバーサル Windows プラットフォーム (UWP) には、[Windows イベント トレーシング (ETW)](https://msdn.microsoft.com/library/windows/desktop/Bb968803) と連動するログ記録 API が用意されており、イベント ログの記録とトレースを行う高機能なソリューションを提供します。 これらの API は [**Windows.Foundation.Diagnostics**](https://msdn.microsoft.com/library/windows/apps/BR206677) 名前空間の一部であり、[**FileLoggingSession**](https://msdn.microsoft.com/library/windows/apps/Dn264138) クラス、[**LoggingActivity**](https://msdn.microsoft.com/library/windows/apps/Dn264195) クラス、[**LoggingChannel**](https://msdn.microsoft.com/library/windows/apps/Dn264202) クラス、および [**LoggingSession**](https://msdn.microsoft.com/library/windows/apps/Dn264217) クラスが含まれます。 アプリ実行中の特定の時点でレポートにメッセージが記録するには、**LoggingChannel** オブジェクトを作成し、オブジェクトの [**LogMessage**](https://msdn.microsoft.com/library/windows/apps/windows.foundation.diagnostics.loggingchannel.logmessage.aspx) メソッドを、次のように呼び出します。 ```csharp // using Windows.Foundation.Diagnostics; //... LoggingChannel myLoggingChannel = new LoggingChannel("MyLoggingChannel"); myLoggingChannel.LogMessage(LoggingLevel.Information, "Here' s my logged message."); //... ``` アプリ実行中の特定の期間にわたってレポートに開始イベントと停止イベントを記録するには、**LoggingActivity** オブジェクトを作成し、オブジェクトの [**LoggingActivity**](https://msdn.microsoft.com/library/windows/apps/windows.foundation.diagnostics.loggingactivity.loggingactivity.aspx) コンストラクターを次のように呼び出します。 ```csharp // using Windows.Foundation.Diagnostics; //... LoggingActivity myLoggingActivity; // myLoggingChannel is defined and initialized in the previous code example. using (myLoggingActivity = new LoggingActivity("MyLoggingActivity"), myLoggingChannel)) { // After this logging activity starts, a start event is logged. // Add code here to do something of interest. } // After this logging activity ends, an end event is logged. //... ``` 「[ログの例](https://go.microsoft.com/fwlink/p/?LinkId=529576)」もご覧ください。 アプリをインストルメント化したら、アプリのパフォーマンスのテストと測定を実行できます。 ## <a name="test-and-measure-against-performance-goals"></a>アプリをテストしてパフォーマンスの目標と照らし合わせる パフォーマンスの計画の一部として、開発のどの時点でパフォーマンスを測定するかを定義することがあります。 測定の目的は、それを実行する時点 (プロトタイプ中、開発中、展開中) に応じて変化します。 プロトタイプの初期段階でのパフォーマンスの測定は非常に有益である可能性があるため、意味のある作業を実行するコードができたら、すぐに測定することをお勧めします。 早いうちに測定しておくと、アプリのどの部分のコストが重要かがわかり、設計の決定事項に関する情報も得られます。 その結果、拡張しやすい高パフォーマンスのアプリを作成できます。 一般に、設計の変更が後になればなるほど、より多くのコストがかかります。 製品サイクルの後半でパフォーマンスを測定すると、十分な対応ができず、高いパフォーマンスが得られない可能性があります。 次の手法とツールを使ってアプリのパフォーマンスをテストして、元のパフォーマンスの目標と比較します。 - さまざまなハードウェア構成 (オールインワン PC、デスクトップ PC、ノート PC、タブレット) でテストを行います。 - さまざまな画面サイズでテストを行います。 画面サイズが大きいとより多くのコンテンツを表示できますが、すべてのコンテンツを表示するとパフォーマンスに悪影響が出る可能性があります。 - テストに影響する可変状態をできるだけ取り除きます。 - テスト デバイスのバックグラウンド アプリを停止します。 Windows で [**設定**スタート] メニューから&gt;**パーソナル化** &gt; **ロック画面**します。 アクティブなアプリを選択し、**[なし]** を選択します。 - テスト デバイスに展開する前に、リリース構成でビルドすることで、アプリをネイティブ コードにコンパイルします。 - 自動メンテナンスがテスト デバイスのパフォーマンスに影響しないようにするため、メンテナンスを手動でトリガーして完了するまで待ちます。 Windows の [スタート] メニューで、**[セキュリティとメンテナンス]** を検索します。 **[メンテナンス]** 領域の **[自動メンテナンス]** で、**[メンテナンスの開始]** を選択し、状態が **[メンテナンスは進行中です]** から別の状態に変化するまで待ちます。 - 一貫性のある測定結果が得られるように、アプリを複数回実行して、テストのランダム要素を排除します。 - 低電力での利用可能性をテストします。 ユーザーのデバイスは、開発用のコンピューターに比べ、大幅に低電力である可能性があります。 Windows は、モバイル デバイスなどの低電力デバイスでの動作を考慮して設計されています。 プラットフォームで動作するアプリが、これらのデバイスでも高いパフォーマンスを発揮できるようにする必要があります。 経験則として、低電力デバイスでの実行速度はデスクトップ コンピューターの約 1/4 であると考えられるため、これに応じて目標を設定します。 - アプリのパフォーマンスを測定するには、Microsoft Visual Studio や Windows Performance Analyzer のようなツールを組み合わせて使います。 Visual Studio は、ソース コードのリンク設定など、アプリに焦点を当てた分析を行うように設計されています。 Windows Performance Analyzer は、システム情報、タッチ操作イベントに関する情報、ディスクの入出力 (I/O) に関する情報、グラフィックス処理ユニット (GPU) のコストに関する情報の提供など、システムに焦点を当てた分析を行うように設計されています。 どちらのツールでも、トレースをキャプチャしてエクスポートし、共有トレースと事後検証トレースを再開することができます。 - 証明書のストアにアプリを送信する前に必ずの「パフォーマンスのテスト」セクションで説明した、パフォーマンスに関連するテスト_ケースをテスト計画に組み込むを[Windows アプリ認定キット テスト](windows-app-certification-kit-tests.md)し「パフォーマンスと安定性」セクションの[UWP アプリのテスト ケース](https://msdn.microsoft.com/library/windows/apps/Dn275879)します。 詳しくは、次のリソースとプロファイリング ツールをご覧ください。 - [Windows Performance Analyzer](https://msdn.microsoft.com/library/windows/apps/xaml/hh448170.aspx) - [Windows パフォーマンス ツールキット](https://msdn.microsoft.com/library/windows/apps/xaml/hh162945.aspx) - [Visual Studio 診断ツールを使用してパフォーマンスを分析します。](https://msdn.microsoft.com/library/windows/apps/xaml/hh696636.aspx) - //build/ セッション「[XAML Performance (XAML のパフォーマンス)](https://channel9.msdn.com/Events/Build/2015/3-698)」 - //build/ セッション「[New XAML Tools in Visual Studio 2015 (Visual Studio 2015 の新しい XAML ツール)](https://channel9.msdn.com/Events/Build/2015/2-697)」 ## <a name="respond-to-the-performance-test-results"></a>パフォーマンス テストの結果に対応する アプリのパフォーマンス テストの結果を分析したら、次のような変更が必要かどうかを判断します。 - 現在の設計の決定事項のいずれかを変更する必要があるか。またはコードを最適化する必要があるか。 - コードに対してインストルメンテーションを追加、削除、または変更する必要があるか。 - パフォーマンス目標のいずれかを変更する必要があるか。 変更が必要な場合は、変更を行った後でインストルメント化に戻り、テストを繰り返します。 ## <a name="optimizing"></a>最適化 アプリのパフォーマンスが重要なコード パスのみ最適化します。この場所に最も多くの時間を費やします。 プロファイリングによって、どの場所がこれに該当するかがわかります。 多くの場合、優れた設計のソフトウェアを作成することと、最高レベルの最適化を実現したコードを記述することは、両立しません。 一般的に、パフォーマンスがそれほど重視されない領域では、開発者の生産性や優れたソフトウェア設計を優先することが適切です。 ======================= File: windows-apps-src/design/motion/xaml-animation.md ======================= <reponame>joannaleecy/windows-uwp-pr.ja-jp<gh_stars>1-10 --- ms.assetid: 0C8DEE75-FB7B-4E59-81E3-55F8D65CD982 title: アニメーションの概要 description: Windows ランタイム アニメーション ライブラリのアニメーションを使って、Windows の見た目や操作感を自分のアプリに取り入れることができます。 ms.date: 02/08/2017 ms.topic: article keywords: windows 10, uwp ms.localizationpriority: medium ms.openlocfilehash: de2544bbd8c7abe9b1852268373cc88913a30227 ms.sourcegitcommit: b034650b684a767274d5d88746faeea373c8e34f ms.translationtype: MT ms.contentlocale: ja-JP ms.lasthandoff: 03/06/2019 ms.locfileid: "57621127" --- # <a name="animations-in-xaml"></a>XAML でのアニメーション UWP のアニメーションは、アプリに躍動感と双方向性を与えます。 Windows ランタイム アニメーション ライブラリのアニメーションを使って、Windows の見た目や操作感を自分のアプリに取り入れることができます。 ここでは、アニメーションの概要と、それぞれのアニメーションが適用される通常のシナリオ例について説明します。 > [!TIP] > XAML 用の Windows ランタイム コントロールには、特定の種類のアニメーションが、アニメーション ライブラリから取得される組み込みの動作として含まれています。 こうしたコントロールを利用することで、アニメーション化された見た目や操作感を自分でプログラミングしなくてもアプリに取り入れることができます。 Windows ランタイム アニメーション ライブラリのアニメーションには次のような利点があります。 - 「[アニメーションのガイドライン](https://msdn.microsoft.com/library/windows/apps/Dn611854)」に従った動き - ユーザーの気をそらさずに必要な情報を伝える、UI 状態の高速で滑らかな切り替え - アプリ内の画面切り替えをユーザーに示す視覚的動作 たとえば、ユーザーがリストに項目を追加すると、新しい項目が即座に表示されてリストが瞬間的に更新されるのではなく、新しい項目が動きを伴ってリストの中に入ります。 他のリスト項目は短時間で移動されて、追加のためのスペースが確保されます。 この画面切り替え動作により、ユーザーはコントロールの動作をはっきりと理解することができます。 Windows 10 バージョン 1607 では、ナビゲーション時にビューの間でアニメーション化する要素が表示されるアニメーションを実装するために、新しい [**ConnectedAnimationService**](https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.media.animation.connectedanimationservice.aspx) API が導入されました。 この API は、他のアニメーション ライブラリ API とは使用パターンが異なります。 **ConnectedAnimationService** の使用については、[リファレンス ページ](https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.media.animation.connectedanimationservice.aspx)をご覧ください。 すべてのシナリオに対応するアニメーションがアニメーション ライブラリに用意されているわけではありません。 XAML でカスタム アニメーションを作ることが必要になる場合もあります。 詳しくは、「[ストーリーボードに設定されたアニメーション](storyboarded-animations.md)」をご覧ください。 さらに、ScrollViewer のスクロール位置に基づいた項目のアニメーション化など、特定の高度なシナリオでは、開発者がビジュアル レイヤーの相互運用を使ってカスタム アニメーションを実装することが必要になる場合があります。 詳しくは、「[ビジュアル レイヤー](https://msdn.microsoft.com/windows/uwp/composition/visual-layer)」をご覧ください。 ## <a name="types-of-animations"></a>アニメーションの種類 Windows ランタイム アニメーション システムとアニメーション ライブラリには、コントロールと UI のその他の部分が動作をアニメーション化できるようにするという、より大きな目的があります。 アニメーションには、いくつかの個別の種類があります。 - *テーマ切り替え*は、UI で特定の条件が変化したときに自動的に適用されます。定義済みの Windows ランタイム XAML UI 型のコントロールまたは要素が対象になります。 これらのアニメーションは、Windows の外観と操作性をサポートし、すべてのアプリが操作モードを切り替えるときに特定の UI シナリオに対して行うことを定義しているので、*テーマ切り替え*と呼ばれます。 テーマ切り替えは、アニメーション ライブラリの一部です。 - *テーマ アニメーション*は、定義済み Windows ランタイム XAML UI 型の 1 つ以上のプロパティに対するアニメーションです。 テーマ アニメーションは、特定の 1 要素を対象とし、コントロール内に特定の表示状態で存在するという点でテーマ切り替えとは異なります。一方、テーマ切り替えは、表示状態の外側に存在するコントロールのプロパティに割り当てられ、表示状態間の切り替えに影響を及ぼします。 Windows ランタイム XAML コントロールの多くは、コントロール テンプレートの一部であり、表示状態がアニメーションのきっかけとなるテーマ アニメーションをストーリーボード内に含んでいます。 テンプレートを変更しない限り、UI のコントロールでこの組み込みのテーマ アニメーションを使うことができます。 ただし、テンプレートを置き換えた場合は、組み込みのテーマ アニメーションも削除されます。 テーマ アニメーションを元に戻すには、コントロールの表示状態セット内にテーマ アニメーションを含むストーリーボードを定義する必要があります。 また、ストーリーボードから表示状態内にないテーマ アニメーションを実行し、[**Begin**](https://msdn.microsoft.com/library/windows/apps/BR210491) メソッドを使って開始することもできますが、これは一般的ではありません。 テーマ アニメーションはアニメーション ライブラリの一部です。 - *視覚的な切り替え*は、コントロールが定義済みの 1 つの表示状態から別の状態に切り替えられたときに適用されます。 これらは、開発者が記述するカスタム アニメーションです。通常は、コントロールのために記述したカスタム テンプレートと、そのテンプレート内の表示状態の定義に関連しています。 アニメーションは状態間の切り替え中だけに実行され、通常は、最大でも数秒間のわずかな時間です。 詳しくは、「[表示状態用にストーリーボードに設定されたアニメーション](https://msdn.microsoft.com/library/windows/apps/xaml/JJ819808#VisualTransition)」の「視覚的な切り替え」のセクションをご覧ください。 - *ストーリーボードに設定されたアニメーション*は、時間の経過と共に Windows ランタイム依存関係プロパティの値をアニメーション化します。 ストーリーボードは、視覚的切り替えの一部として定義することも、実行時にアプリケーションによってトリガーすることもできます。 詳しくは、「[ストーリーボードに設定されたアニメーション](storyboarded-animations.md)」をご覧ください。 依存関係プロパティとその存在場所について詳しくは、「[依存関係プロパティの概要](https://msdn.microsoft.com/library/windows/apps/Mt185583)」をご覧ください。 - 新しい [**ConnectedAnimationService**](https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.media.animation.connectedanimationservice.aspx) API によって提供される*接続型アニメーション*により、開発者はナビゲーション時にビューの間で要素がアニメーション化される効果を容易に作成できます。 この API は、Windows 10 バージョン 1607 以降で使うことができます。 詳しくは、「[**ConnectedAnimationService**](https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.media.animation.connectedanimationservice.aspx)」をご覧ください。 ## <a name="animations-available-in-the-library"></a>ライブラリに用意されているアニメーション アニメーション ライブラリには、次のアニメーションが用意されています。 アニメーションの名前をクリックすると、主な使用シナリオ、その定義方法、アニメーション例の詳しい情報が表示されます。 - [ページ遷移](#page-transition):内のページ遷移アニメーションを[**フレーム**](https://msdn.microsoft.com/library/windows/apps/br242682)します。 - [コンテンツと entrance の遷移](#content-transition-and-entrance-transition):ビューの内外に 1 つの部分または一連のコンテンツをアニメーション化します。 - [フェードの入力/出力、およびクロスフェード](#fade-in-out-and-crossfade):一時的な要素またはコントロールを示しています。 または、コンテンツ領域を更新します。 - [ポインター アップ/ダウン](#pointer-up-down):タイルには、タップまたはクリックの視覚的なフィードバックを提供します。 - [位置変更](#reposition):新しい位置に要素を移動します。 - [ポップアップの表示/非表示](#show-hide-popup):コンテキストの UI のビューの上部に表示されます。 - [端の UI の表示/非表示](#show-hide-edge-ui):ビューの内外には、パネルなどの大規模な UI を含め、edge ベースの UI にスライドします。 - [リスト項目の変更](#list-item-changes):追加するか、項目を並べ替え、一覧から項目を削除します。 - [ドラッグ/ドロップ](#drag-drop):ドラッグ アンド ドロップ操作中に視覚的なフィードバックを提供します。 ### <a name="page-transition"></a>ページ切り替え アプリ内でのナビゲーションをアニメーション化するには、ページ切り替えを使います。 ほぼすべてのアプリで、ある種のナビゲーションが使用されるため、ページ切り替えアニメーションはアプリで使用される最も一般的な種類のテーマ アニメーションです。 ページ切り替えの API について詳しくは、「[**NavigationThemeTransition**](https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.media.animation.navigationthemetransition)」をご覧ください。 ### <a name="content-transition-and-entrance-transition"></a>コンテンツ切り替えと開始切り替え コンテンツ切り替えアニメーション ([**ContentThemeTransition**](https://msdn.microsoft.com/library/windows/apps/BR243103)) を使って、コンテンツの断片やまとまりを移動して現在の画面に表示したり、画面から消したりします。 たとえば、コンテンツ切り替えアニメーションは、ページが最初に読み込まれたとき、またはページの 1 セクションのコンテンツを変更したときに表示できなかったコンテンツを表示する場合に使われます。 [**EntranceThemeTransition** ](https://msdn.microsoft.com/library/windows/apps/BR210288)ページまたは UI の大きな部分が最初に読み込まれるときに、コンテンツに適用可能な動きを表します。 したがって、最初にコンテンツを表示するときは、コンテンツ切り替え時とは異なるフィードバックとすることができます。 [**EntranceThemeTransition** ](https://msdn.microsoft.com/library/windows/apps/BR210288)と同じですが、 [ **NavigationThemeTransition** ](https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.media.animation.navigationthemetransition)既定のパラメーター以外の使用可能性がありますが、 [ **フレーム**](https://msdn.microsoft.com/library/windows/apps/br242682)します。 <span id="fade-in-out-and-crossfade"/> ### <a name="fade-inout-and-crossfade"></a>フェード イン/アウトとクロスフェード フェード イン/アウト アニメーションを使って、一時的な UI またはコントロールを表示したり、非表示にしたりします。 XAML では、これは [**FadeInThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/BR210298) と [**FadeOutThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/BR210302) として表されます。 たとえば、ユーザーの操作により新しいコントロールが表示されるアプリ バーでこのアニメーションを使います。 また、一定期間ユーザーの入力が検出されないとフェード アウトする一時的なスクロール バーとパン インジケーターにもこのアニメーションが適用されます。 アプリで、コンテンツが動的に読み込まれてプレースホルダー項目から最終項目に切り替わるときにもフェード イン アニメーションが使われます。 クロスフェード アニメーションを使って、画面の現在のコンテンツを更新している場合など、項目の状態が変化しているときにスムーズに切り替えます。 XAML アニメーション ライブラリには専用のクロスフェード アニメーション ([**crossFade**](https://msdn.microsoft.com/library/windows/apps/BR212661) と同等のもの) がありませんが、タイミングを重ねて [**FadeInThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/BR210298) と [**FadeOutThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/BR210302) を使うことで同じ結果を実現できます。 <span id="pointer-up-down"/> ### <a name="pointer-updown"></a>ポインター アップ/ダウン [ **PointerUpThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/Hh969168) アニメーションと [**PointerDownThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/Hh969164) アニメーションを使って、タイルでのタップやクリックが正常に行われたことについてユーザーにフィードバックを提供します。 たとえば、ユーザーがタイルを下にクリックまたはタップすると、ポインター ダウン アニメーションが再生されます。 クリックまたはタップが解放されると、ポインター アップ アニメーションが再生されます。 ### <a name="reposition"></a>位置の変更 位置変更アニメーション ([**RepositionThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/BR210421) または [**RepositionThemeTransition**](https://msdn.microsoft.com/library/windows/apps/BR210429)) を使って、要素を新しい位置に移動します。 たとえば、項目のコントロールでヘッダーを動かすと、位置変更アニメーションが適用されます。 <span id="show-hide-popup"/> ### <a name="showhide-popup"></a>ポップアップの表示/非表示 [ **PopInThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/BR210383) と [**PopOutThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/BR210391) を使って、[**Popup**](https://msdn.microsoft.com/library/windows/apps/BR227842) や類似のコンテキストに沿った UI を現在の画面に表示し、画面から消します。 [**PopupThemeTransition** ](https://msdn.microsoft.com/library/windows/apps/Hh969172)が光をする場合に有益なフィードバックをテーマの切り替えがポップアップを閉じます。 <span id="show-hide-edge-ui"/> ### <a name="showhide-edge-ui"></a>エッジ (端) UI の表示/非表示 [ **EdgeUIThemeTransition**](https://msdn.microsoft.com/library/windows/apps/Hh702324) アニメーションを使って、端に基づく小さい UI をスライドして画面に表示したり、画面から消したりします。 たとえば、画面の上部や下部にカスタムのアプリ バーを表示したり、画面の上部にエラーや警告の UI サーフェスを表示したりするときに、これらのアニメーションを使います。 ウィンドウまたはパネルの表示や非表示には [**PaneThemeTransition**](https://msdn.microsoft.com/library/windows/apps/Hh969160) アニメーションを使います。 これはカスタム キーボードや作業ウィンドウのような端に基づく大きな UI 用です。 ### <a name="list-item-changes"></a>リスト項目の変更 [ **AddDeleteThemeTransition**](https://msdn.microsoft.com/library/windows/apps/BR243047) アニメーションは、既にあるリストに項目の追加時または削除時のアニメーション動作を追加するときに使います。 追加時の切り替えの場合、最初にリスト内の既にある項目の位置が変更され、新しい項目用のスペースが確保されてから、新しい項目が追加されます。 削除時の切り替えの場合、リストから項目が削除され、必要に応じて、残りのリスト項目の位置が変更されます。 項目のリスト内の位置が変わった場合に適用される別の [**ReorderThemeTransition**](https://msdn.microsoft.com/library/windows/apps/BR210409) もあります。 これは、項目を削除してそれを新しい位置に追加するときに使われる関連する削除/追加アニメーションとは異なるアニメーションになります。 これらのアニメーションは、既定の [**ListView**](https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.listview.aspx) テンプレートと [**GridView**](https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.gridview.aspx) テンプレートに含まれているため、これらのコントロールを既に使用している場合、これらのアニメーションを手動で追加する必要はありません。 <span id="drag-drop"/> ### <a name="dragdrop"></a>ドラッグ/ドロップ ドラッグ アニメーション ([**DragItemThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/BR243173)、[**DragOverThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/BR243177)) とドロップ アニメーション ([**DropTargetItemThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/BR243185)) を使って、ユーザーが項目をドラッグまたはドロップするときに視覚的なフィードバックを提供します。 有効にすると、リストにドロップした項目の前後の項目の位置が変更されることがアニメーションによってユーザーに示されます。 このアニメーションを使うと、ユーザーは項目を現在の位置にドロップしたときに、項目がリスト内のどの位置に配置されるかを把握できるため便利です。 アニメーションでは、ドラッグしている項目を、リストの他の 2 つの項目間にドロップできること、およびそれらの項目は移動することを視覚的なフィードバックで示します。 ## <a name="using-animations-with-custom-controls"></a>アニメーションとカスタム コントロールの使用 カスタマイズした Windows ランタイム コントロールを作るときに、どのアニメーションを使う必要があるかについての推奨事項を次の表にまとめます。 | UI の種類 | 推奨されるアニメーション | |---------|-----------------------| | ダイアログ ボックス | [**FadeInThemeAnimation** ](https://msdn.microsoft.com/library/windows/apps/BR210298)と[ **FadeOutThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/BR210302) | | ポップアップ | [**PopInThemeAnimation** ](https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.media.animation.popinthemeanimation.popinthemeanimation.aspx)と[ **PopOutThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.media.animation.popoutthemeanimation.popoutthemeanimation) | | ヒント | [**FadeInThemeAnimation** ](https://msdn.microsoft.com/library/windows/apps/BR210298)と[ **FadeOutThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/BR210302) | | ショートカット メニュー | [**PopInThemeAnimation** ](https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.media.animation.popinthemeanimation.popinthemeanimation.aspx)と[ **PopOutThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.media.animation.popoutthemeanimation.popoutthemeanimation) | | コマンド バー | [**EdgeUIThemeTransition**](https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.media.animation.edgeuithemetransition.edgeuithemetransition) | | 作業ウィンドウまたは端に基づくパネル | [**PaneThemeTransition**](https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.media.animation.panethemetransition.panethemetransition) | | 各種 UI コンテナーのコンテンツ | [**ContentThemeTransition**](https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.media.animation.contentthemetransition.contentthemetransition) | | コントロールに対して (または他に該当するアニメーションがない場合に) 適用する | [**FadeInThemeAnimation** ](https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.media.animation.fadeinthemeanimation.fadeinthemeanimation.aspx)と[ **FadeOutThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/BR210302) |   ## <a name="transition-animation-examples"></a>切り替え効果のアニメーションの例 アプリが使うアニメーションは、ユーザーを困惑させることなく、ユーザー インターフェイスを豊かに、魅力的にするものであるのが理想です。 1 つの方法は、切り替え効果のアニメーションを UI に適用することです。画面に何かが出入りするなど、何かの変化が起きたときに、アニメーションによって、その変化にユーザーの注意を惹き付けます。 たとえば、ボタンの場合、単に画面に表示したり画面から消したりするのではなく、フェード イン/フェード アウトさせるようにします。 一貫性のあるお勧めの (標準的な) 切り替え効果アニメーションを作ることができる API を多数用意しました。 ここでは、ボタンがスライドしながら勢いよく画面に表示されるアニメーションの適用方法を紹介します。 ```xml <Button Content="Transitioning Button"> <Button.Transitions> <TransitionCollection> <EntranceThemeTransition/> </TransitionCollection> </Button.Transitions> </Button> ``` このコードでは、ボタンの切り替え効果のコレクション (TransitionCollection) に [**EntranceThemeTransition**](https://msdn.microsoft.com/library/windows/apps/BR210288) オブジェクトを追加します。 これで、ボタンが最初にレンダリングされるときに、ただ表示されるのではなく、スライドしながら勢いよく画面に表示されるようになります。 アニメーション オブジェクトには、スライドする距離と方向を調整する目的でいくつかのプロパティを設定できますが、API としては、特定のシナリオ、つまり、出入り口 (entrance) を目立たせることを意図した非常に単純なものです。 切り替え効果のアニメーションのテーマをアプリのスタイル リソースで定義して、統一感のある効果を適用することもできます。 先ほどの例に相当する内容を [**Style**](https://msdn.microsoft.com/library/windows/apps/BR208849) を使って実現したのが次のコードです。 ```xml <UserControl.Resources> <Style x:Key="DefaultButtonStyle" TargetType="Button"> <Setter Property="Transitions"> <Setter.Value> <TransitionCollection> <EntranceThemeTransition/> </TransitionCollection> </Setter.Value> </Setter> </Style> </UserControl.Resources> <StackPanel x:Name="LayoutRoot"> <Button Style="{StaticResource DefaultButtonStyle}" Content="Transitioning Button"/> </StackPanel> ``` これまでの例では、テーマ切り替えを個々のコントロールに適用していましたが、それをオブジェクトのコンテナーに適用すると、もっとおもしろいことが起こります。 コンテナーに含まれているすべての子オブジェクトに、切り替え効果が適用されます。 次の例では、[**EntranceThemeTransition**](https://msdn.microsoft.com/library/windows/apps/BR210288) を四角形から成る [**Grid**](https://msdn.microsoft.com/library/windows/apps/BR242704) に適用しています。 ```xml <!-- If you set an EntranceThemeTransition animation on a panel, the children of the panel will automatically offset when they animate into view to create a visually appealing entrance. --> <ItemsControl Grid.Row="1" x:Name="rectangleItems"> <ItemsControl.ItemContainerTransitions> <TransitionCollection> <EntranceThemeTransition/> </TransitionCollection> </ItemsControl.ItemContainerTransitions> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <WrapGrid Height="400"/> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <!-- The sequence children appear depends on their order in the panel's children, not necessarily on where they render on the screen. Be sure to arrange your child elements in the order you want them to transition into view. --> <ItemsControl.Items> <Rectangle Fill="Red" Width="100" Height="100" Margin="10"/> <Rectangle Fill="Red" Width="100" Height="100" Margin="10"/> <Rectangle Fill="Red" Width="100" Height="100" Margin="10"/> <Rectangle Fill="Red" Width="100" Height="100" Margin="10"/> <Rectangle Fill="Red" Width="100" Height="100" Margin="10"/> <Rectangle Fill="Red" Width="100" Height="100" Margin="10"/> <Rectangle Fill="Red" Width="100" Height="100" Margin="10"/> <Rectangle Fill="Red" Width="100" Height="100" Margin="10"/> <Rectangle Fill="Red" Width="100" Height="100" Margin="10"/> </ItemsControl.Items> </ItemsControl> ``` 切り替え効果が適用された [**Grid**](https://msdn.microsoft.com/library/windows/apps/BR242704) の子である四角形が次々に表示され、見ていて楽しい気分になります。同じアニメーションを個々の四角形に適用した場合は、すべての四角形がいっせいに表示されますが、それとは対照的です。 このアニメーションのデモを次に示します。 ![子である四角形をビューに切り替えて表示するアニメーション](./images/animation-child-rectangles.gif) いずれかの子の位置が変化した場合は、コンテナーの子オブジェクトを再度流し込むことができます。 次の例では、[**RepositionThemeTransition**](https://msdn.microsoft.com/library/windows/apps/BR210429) を四角形から成るグリッドに適用しています。 いずれかの四角形を削除すると、その他すべての四角形が新しい位置に再度流し込まれます。 ```xml <Button Content="Remove Rectangle" Click="RemoveButton_Click"/> <ItemsControl Grid.Row="1" x:Name="rectangleItems"> <ItemsControl.ItemContainerTransitions> <TransitionCollection> <!-- Without this, there would be no animation when items are removed. --> <RepositionThemeTransition/> </TransitionCollection> </ItemsControl.ItemContainerTransitions> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <WrapGrid Height="400"/> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <!-- All these rectangles are just to demonstrate how the items in the grid re-flow into position when one of the child items are removed. --> <ItemsControl.Items> <Rectangle Fill="Red" Width="100" Height="100" Margin="10"/> <Rectangle Fill="Red" Width="100" Height="100" Margin="10"/> <Rectangle Fill="Red" Width="100" Height="100" Margin="10"/> <Rectangle Fill="Red" Width="100" Height="100" Margin="10"/> <Rectangle Fill="Red" Width="100" Height="100" Margin="10"/> <Rectangle Fill="Red" Width="100" Height="100" Margin="10"/> <Rectangle Fill="Red" Width="100" Height="100" Margin="10"/> <Rectangle Fill="Red" Width="100" Height="100" Margin="10"/> <Rectangle Fill="Red" Width="100" Height="100" Margin="10"/> </ItemsControl.Items> </ItemsControl> ``` ```cs private void RemoveButton_Click(object sender, RoutedEventArgs e) { if (rectangleItems.Items.Count > 0) { rectangleItems.Items.RemoveAt(0); } } ``` ```cpp //.h private: void RemoveButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); //.cpp void BlankPage::RemoveButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) { if (rectangleItems->Items->Size > 0) { rectangleItems->Items->RemoveAt(0); } } ``` 切り替え効果のアニメーションは、1 つのオブジェクトまたは 1 つのオブジェクト コンテナーに対し複数適用することができます。 たとえば、アニメーションで表示する一連の四角形があり、四角形の位置が変化したときにもアニメーションを適用する必要がある場合、[**RepositionThemeTransition**](https://msdn.microsoft.com/library/windows/apps/BR210429) と [**EntranceThemeTransition**](https://msdn.microsoft.com/library/windows/apps/BR210288) を次のように適用します。 ```xml ... <ItemsControl.ItemContainerTransitions> <TransitionCollection> <EntranceThemeTransition/> <RepositionThemeTransition/> </TransitionCollection> </ItemsControl.ItemContainerTransitions> ... ``` 切り替え効果には、さまざまな種類が存在し、UI 要素の追加時、削除時、並べ替え時などに、それに応じたアニメーションを適用することができます。 これらの API はすべて、名前に "ThemeTransition" という単語が含まれています。 | API | 説明 | |-----|-------------| | [**NavigationThemeTransition**](https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.media.animation.navigationthemetransition) | [ **Frame**](https://msdn.microsoft.com/library/windows/apps/br242682) 内でのページ ナビゲーションに Windows パーソナリティ アニメーションを提供します。 | | [**AddDeleteThemeTransition**](https://msdn.microsoft.com/library/windows/apps/BR243047) | コントロールの子やコンテンツが追加されたり削除されたりしたときの切り替え動作のアニメーションです。 ここでいうコントロールは通常、項目コンテナーです。 | | [**ContentThemeTransition**](https://msdn.microsoft.com/library/windows/apps/BR243103) | コントロールのコンテンツが変化しているときの切り替え動作のアニメーションです。 このアニメーションは、[**AddDeleteThemeTransition**](https://msdn.microsoft.com/library/windows/apps/BR243047) に追加する形で適用することができます。 | | [**EdgeUIThemeTransition**](https://msdn.microsoft.com/library/windows/apps/Hh702324) | (小さい) エッジ UI の切り替え動作のアニメーションです。 | | [**EntranceThemeTransition**](https://msdn.microsoft.com/library/windows/apps/BR210288) | コントロールが最初に表示されるときの切り替え動作のアニメーションです。 | | [**PaneThemeTransition**](https://msdn.microsoft.com/library/windows/apps/Hh969160) | パネル (大きなエッジ UI) の切り替え動作のアニメーションです。 | | [**PopupThemeTransition**](https://msdn.microsoft.com/library/windows/apps/Hh969172) | コントロールのポップイン コンポーネント (オブジェクトに関するツールヒント風の UI など) が表示されるときに適用される切り替え動作のアニメーションです。 | | [**ReorderThemeTransition**](https://msdn.microsoft.com/library/windows/apps/BR210409) | リスト ビュー コントロールの項目の順序が変わったときの切り替え動作のアニメーションです。 通常、この変化は、ドラッグ アンド ドロップ操作の結果として起こります。 コントロールやテーマの種類によって、アニメーションの特性が異なる場合があります。 | | [**RepositionThemeTransition**](https://msdn.microsoft.com/library/windows/apps/BR210429) | コントロールの位置が変わったときの切り替え動作のアニメーションです。 |   ## <a name="theme-animation-examples"></a>テーマ アニメーションの例 切り替え効果のアニメーションは簡単に適用できます。 しかし、場合によっては、アニメーション効果のタイミングや順序をもっと細かく制御する必要があります。 テーマ アニメーションを使うと、アニメーションの動作に一貫したテーマを使いながら、より細かな制御を行うことができます。 テーマ アニメーションも、カスタム アニメーションよりマークアップを少なくする必要があります。 ここでは、[**FadeOutThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/BR210302) を使って、四角形をフェード アウトさせています。 ```xml <StackPanel> <StackPanel.Resources> <Storyboard x:Name="myStoryboard"> <FadeOutThemeAnimation TargetName="myRectangle" /> </Storyboard> </StackPanel.Resources> <Rectangle PointerPressed="Rectangle_Tapped" x:Name="myRectangle" Fill="Blue" Width="200" Height="300"/> </StackPanel> ``` ```cs // When the user taps the rectangle, the animation begins. private void Rectangle_Tapped(object sender, PointerRoutedEventArgs e) { myStoryboard.Begin(); } ``` ```vb ' When the user taps the rectangle, the animation begins. Private Sub Rectangle_Tapped(sender As Object, e As PointerRoutedEventArgs) myStoryboard.Begin() End Sub ``` ```cpp //.h void Rectangle_Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e); //.cpp void BlankPage::Rectangle_Tapped(Object^ sender, PointerRoutedEventArgs^ e) { myStoryboard->Begin(); } ``` 切り替え効果のアニメーションとは異なり、テーマ アニメーションでは、アニメーションを自動的に実行する組み込みのトリガー (切り替え) がありません。 XAML でテーマ アニメーションを定義するときは、[**Storyboard**](https://msdn.microsoft.com/library/windows/apps/BR210490) を使ってそれを格納する必要があります。 アニメーションの既定の動作を変更することもできます。 たとえば、[**FadeOutThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/BR210302) の [**Duration**](https://msdn.microsoft.com/library/windows/apps/BR243207) の時間値を増やすと、フェード アウトの速度を遅くすることができます。 **注**  の基本的なアニメーションの手法を示すためを使用してアプリのコードのメソッドを呼び出して、アニメーションを開始する[**ストーリー ボード**](https://msdn.microsoft.com/library/windows/apps/BR210490)します。 制御できますが、どのように**ストーリー ボード**アニメーションを使用して実行、 [**開始**](https://msdn.microsoft.com/library/windows/apps/BR210491)、 [**停止**](https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.media.animation.storyboard.stop)、 [**一時停止**](https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.media.animation.storyboard.pause.aspx)、および[**再開**](https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.media.animation.storyboard.resume.aspx) **ストーリー ボード**メソッド。 ただし、これはライブラリ アニメーションをアプリに含める通常の方法ではありません。 むしろ、通常は、コントロールまたは要素に適用される XAML スタイルとテンプレートにライブラリ アニメーションを統合します。 テンプレートと表示状態の説明はもう少し込み入ったものになります。 ただし、表示状態でライブラリ アニメーションを使用する方法については、「[表示状態用にストーリーボードに設定されたアニメーション](https://msdn.microsoft.com/library/windows/apps/xaml/JJ819808)」トピックの一部として取り上げています。   そのほかにもさまざまなテーマ アニメーションを UI 要素に適用して、アニメーション効果を作ることができます。 これらの API はすべて、名前に "ThemeAnimation" という単語が含まれています。 | API | 説明 | |-----|-------------| | [**DragItemThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/BR243173) | ドラッグされている項目要素に適用される事前構成済みのアニメーションを表します。 | | [**DragOverThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/BR243177) | ドラッグされている要素の下にある要素に適用される事前構成済みのアニメーションを表します。 | | [**DropTargetItemThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/BR243185) | ドロップ先となりうる要素に適用される事前構成済みのアニメーションです。 | | [**FadeInThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/BR210298) | 透明から不透明への変化を表す事前構成済みのアニメーションです。コントロールが最初に表示されるときに適用されます。 | | [**FadeOutThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/BR210302) | 透明から不透明への変化を表す事前構成済みのアニメーションです。コントロールが UI から削除されたり非表示になるときに適用されます。 | | [**PointerDownThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/Hh969164) | 項目または要素をタップまたはクリックするユーザー操作の事前構成済みのアニメーションです。 | | [**PointerUpThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/Hh969168) | ユーザーが項目または要素をタップし、指を離すと実行される事前構成済みのアニメーションです。 | | [**PopInThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/BR210383) | コントロールのポップイン コンポーネントが表示されるときに適用される事前構成済みのアニメーションです。 このアニメーションには、不透明度と変換が組み合わされています。 | | [**PopOutThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/BR210391) | コントロールのポップイン コンポーネントが閉じたり削除されたりするときに適用される事前構成済みのアニメーションです。 このアニメーションには、不透明度と変換が組み合わされています。 | | [**RepositionThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/BR210421) | オブジェクトの位置が変更されたときに適用される事前構成済みのアニメーションです。 | | [**SplitCloseThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/BR210454) | [ **ComboBox**](https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.combobox.aspx) を開閉するときのスタイルのアニメーションでターゲット UI を非表示にする事前構成済みのアニメーションです。 | | [**SplitOpenThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/BR210472) | [ **ComboBox**](https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.combobox.aspx) を開閉するときのスタイルのアニメーションでターゲット UI を表示する事前構成済みのアニメーションです。 | | [**DrillInThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.media.animation.drillinthemeanimation) | マスター ページから詳細ページのように、ユーザーが論理階層を順方向に移動するときに実行される事前構成済みのアニメーションを表します。 | | [**DrillOutThemeAnimation**](https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.media.animation.drilloutthemeanimation.aspx) | 詳細ページからマスター ページのように、ユーザーが論理階層を逆方向に移動するときに実行される事前構成済みのアニメーションを表します。 |   ## <a name="create-your-own-animations"></a>カスタム アニメーションの作成 テーマ アニメーションでは自分のニーズが満たせない場合は、アニメーションを独自に作ることができます。 オブジェクトのプロパティ値のいくつかをアニメーション化することによって、オブジェクトに動きを与えることができます。 たとえば、四角形の幅や [**RotateTransform**](https://msdn.microsoft.com/library/windows/apps/BR242932) の角度、ボタンの色の値をアニメーション化することができます。 この種のカスタム アニメーションは、事前構成済みのアニメーションの種類として Windows ランタイムに既に用意されているライブラリ アニメーションと区別するために、"ストーリーボードに設定されたアニメーション" と呼ばれています。 ストーリーボードに設定されたアニメーションの場合、特定の型の値を変更できるアニメーション (**Double** をアニメーションできる [**DoubleAnimation**](https://msdn.microsoft.com/library/windows/apps/BR243136) など) を使い、そのアニメーションを [**Storyboard**](https://msdn.microsoft.com/library/windows/apps/BR210490) 内に配置して制御します。 アニメーション化するためには、アニメーション化しているプロパティが*依存関係プロパティ*である必要があります。 依存関係プロパティについて詳しくは、「[依存関係プロパティの概要](https://msdn.microsoft.com/library/windows/apps/Mt185583)」をご覧ください。 ストーリーボードに設定されたカスタム アニメーションの作成について詳しくは、対象に選ぶ方法や制御方法も含め、「[ストーリーボードに設定されたアニメーション](storyboarded-animations.md)」をご覧ください。 ストーリーボードに設定されたカスタム アニメーションを定義する際に XAML のアプリ UI 定義で最大となるのは、XAML でコントロールの表示状態を定義する場合です。 これを行うのは、新たにコントロール クラスを作成するか、既にあるコントロールのうち、コントロール テンプレートに表示状態があるものに対してもう一度テンプレートを作成する場合です。 詳しくは、「[表示状態用にストーリーボードに設定されたアニメーション](https://msdn.microsoft.com/library/windows/apps/xaml/JJ819808)」をご覧ください。     ======================= File: windows-apps-src/audio-video-camera/system-media-transport-controls.md ======================= --- ms.assetid: EFCF84D0-2F4C-454D-97DA-249E9EAA806C description: SystemMediaTransportControls クラスを使うと、Windows に組み込まれているシステム メディア トランスポート コントロールをアプリで使って、現在アプリで再生中のメディアに関してコントロールに表示されるメタデータを更新できるようになります。 title: システム メディア トランスポート コントロールの手動制御 ms.date: 02/08/2017 ms.topic: article keywords: windows 10, uwp ms.localizationpriority: medium ms.openlocfilehash: 6be1680d1ce843c1fbe7105dc2027e764095495a ms.sourcegitcommit: b034650b684a767274d5d88746faeea373c8e34f ms.translationtype: MT ms.contentlocale: ja-JP ms.lasthandoff: 03/06/2019 ms.locfileid: "57635657" --- # <a name="manual-control-of-the-system-media-transport-controls"></a>システム メディア トランスポート コントロールの手動制御 Windows 10 バージョン 1607 以降、[**MediaPlayer**](https://msdn.microsoft.com/library/windows/apps/Windows.Media.Playback.MediaPlayer) クラスを使ってメディアを再生する UWP アプリは、既定でシステム メディア トランスポート コントロール (SMTC) と自動的に統合されます。 これは、ほとんどのシナリオの SMTC と対話するための推奨される方法です。 SMTC の **MediaPlayer** との既定の統合のカスタマイズについて詳しくは、「[システム メディア トランスポート コントロールとの統合](integrate-with-systemmediatransportcontrols.md)」をご覧ください。 SMTC の手動コントロールの実装が必要になるシナリオがいくつかあります。 たとえば、[**MediaTimelineController**](https://msdn.microsoft.com/library/windows/apps/Windows.Media.MediaTimelineController) を使って 1 つ以上のメディア プレーヤーの再生を制御する場合です。 複数のメディア プレーヤーを使用していて、アプリ用に SMTC の 1 つのインスタンスだけが必要な場合もそうです。 [ **MediaElement**](https://msdn.microsoft.com/library/windows/apps/Windows.UI.Xaml.Controls.MediaElement) を使ってメディアを再生する場合は、SMTC を手動で制御する必要があります。 ## <a name="set-up-transport-controls"></a>トランスポート コントロールをセットアップする **MediaPlayer** 使ってメディアを再生している場合は、[**MediaPlayer.SystemMediaTransportControls**](https://msdn.microsoft.com/library/windows/apps/Windows.Media.Playback.MediaPlayer.SystemMediaTransportControls) プロパティにアクセスして [**SystemMediaTransportControls**](https://msdn.microsoft.com/library/windows/apps/Windows.Media.SystemMediaTransportControls) のインスタンスを取得できます。 SMTC を手動で制御する場合は、[**CommandManager.IsEnabled**](https://msdn.microsoft.com/library/windows/apps/Windows.Media.Playback.MediaPlaybackCommandManager.IsEnabled) プロパティを false に設定して、**MediaPlayer** によって提供される自動統合を無効にする必要があります。 > [!NOTE] > [ **IsEnabled**](https://msdn.microsoft.com/library/windows/apps/Windows.Media.Playback.MediaPlaybackCommandManager.IsEnabled) を false に設定して、[**MediaPlayer**](https://msdn.microsoft.com/library/windows/apps/Windows.Media.Playback.MediaPlayer) の [**MediaPlaybackCommandManager**](https://msdn.microsoft.com/library/windows/apps/Windows.Media.Playback.MediaPlaybackCommandManager) を無効にすると、**MediaPlayerElement** で提供される **MediaPlayer** と [**TransportControls**](https://msdn.microsoft.com/library/windows/apps/Windows.UI.Xaml.Controls.MediaPlayerElement.TransportControls) の間のリンクが解除されます。このため組み込みトランスポート コントロールはプレーヤーの再生を自動的に制御しなくなります。 代わりに、独自のコントロールを実装して、**MediaPlayer** を制御する必要があります。 [!code-cs[InitSMTCMediaPlayer](./code/SMTCWin10/cs/MainPage.xaml.cs#SnippetInitSMTCMediaPlayer)] [ **GetForCurrentView**](https://msdn.microsoft.com/library/windows/apps/dn278708) を呼び出して、[**SystemMediaTransportControls**](https://msdn.microsoft.com/library/windows/apps/dn278677) のインスタンスを取得することもできます。 **MediaElement** を使ってメディアを再生している場合は、この方法でオブジェクトを取得する必要があります。 [!code-cs[InitSMTCMediaElement](./code/SMTCWin10/cs/MainPage.xaml.cs#SnippetInitSMTCMediaElement)] **SystemMediaTransportControls** オブジェクトの対応する "is enabled" プロパティ ([**IsPlayEnabled**](https://msdn.microsoft.com/library/windows/apps/dn278714)、[**IsPauseEnabled**](https://msdn.microsoft.com/library/windows/apps/dn278713)、[**IsNextEnabled**](https://msdn.microsoft.com/library/windows/apps/dn278712)、[**IsPreviousEnabled**](https://msdn.microsoft.com/library/windows/apps/dn278715) など) を設定することで、アプリで使うボタンを有効にします。 利用可能なすべてのコントロールの一覧については、**SystemMediaTransportControls** のリファレンス ドキュメントをご覧ください。 [!code-cs[EnableContols](./code/SMTCWin10/cs/MainPage.xaml.cs#SnippetEnableContols)] ユーザーがボタンを押したときに通知を受信するために、[**ButtonPressed**](https://msdn.microsoft.com/library/windows/apps/dn278706) イベントのハンドラーを登録します。 [!code-cs[RegisterButtonPressed](./code/SMTCWin10/cs/MainPage.xaml.cs#SnippetRegisterButtonPressed)] ## <a name="handle-system-media-transport-controls-button-presses"></a>システム メディア トランスポート コントロールの押されたボタンを処理する [ **ButtonPressed**](https://msdn.microsoft.com/library/windows/apps/dn278706) イベントは、有効なボタンの 1 つが押されたときにシステム トランスポート コントロールで発生します。 イベント ハンドラーに渡される [**SystemMediaTransportControlsButtonPressedEventArgs**](https://msdn.microsoft.com/library/windows/apps/dn278683) の [**Button**](https://msdn.microsoft.com/library/windows/apps/dn278685) プロパティは、有効なボタンのうちどれが押されたかを示す [**SystemMediaTransportControlsButton**](https://msdn.microsoft.com/library/windows/apps/dn278681) 列挙体のメンバーです。 [ **ButtonPressed**](https://msdn.microsoft.com/library/windows/apps/dn278706) イベント ハンドラーから UI スレッド上のオブジェクト ([**MediaElement**](https://msdn.microsoft.com/library/windows/apps/br242926) オブジェクトなど) を更新するには、[**CoreDispatcher**](https://msdn.microsoft.com/library/windows/apps/br208211) を介して呼び出しをマーシャリングする必要があります。 これは、**ButtonPressed** イベント ハンドラーが UI スレッドから呼び出されず、UI を直接変更しようとすると例外が発生するためです。 [!code-cs[SystemMediaTransportControlsButtonPressed](./code/SMTCWin10/cs/MainPage.xaml.cs#SnippetSystemMediaTransportControlsButtonPressed)] ## <a name="update-the-system-media-transport-controls-with-the-current-media-status"></a>現在のメディアの状態でシステム メディア トランスポート コントロールを更新する システムで現在の状態を反映してコントロールを更新できるように、メディアの状態が変更されたときには、それを [**SystemMediaTransportControls**](https://msdn.microsoft.com/library/windows/apps/dn278677) に通知する必要があります。 そのためには、メディアの状態が変更されたときに発生する [**MediaElement**](https://msdn.microsoft.com/library/windows/apps/br242926) の [**CurrentStateChanged**](https://msdn.microsoft.com/library/windows/apps/br227375) イベント内から、[**PlaybackStatus**](https://msdn.microsoft.com/library/windows/apps/dn278719) プロパティを適切な [**MediaPlaybackStatus**](https://msdn.microsoft.com/library/windows/apps/dn278665) 値に設定します。 [!code-cs[SystemMediaTransportControlsStateChange](./code/SMTCWin10/cs/MainPage.xaml.cs#SnippetSystemMediaTransportControlsStateChange)] ## <a name="update-the-system-media-transport-controls-with-media-info-and-thumbnails"></a>メディアの情報と縮小表示でシステム メディア トランスポート コントロールを更新する [ **SystemMediaTransportControlsDisplayUpdater**](https://msdn.microsoft.com/library/windows/apps/dn278686) クラスを使って、現在再生されているメディア項目の曲のタイトルやアルバム アートなど、トランスポート コントロールに表示されるメディア情報を更新します。 [ **SystemMediaTransportControls.DisplayUpdater**](https://msdn.microsoft.com/library/windows/apps/dn278707) プロパティを使って、このクラスのインスタンスを取得します。 一般的なシナリオの場合、メタデータを渡すための推奨される方法は、現在再生中のメディア ファイルを渡して [**CopyFromFileAsync**](https://msdn.microsoft.com/library/windows/apps/dn278694) を呼び出すことです。 表示アップデーターによって、ファイルからメタデータと縮小表示画像が自動的に抽出されます。 [ **Update**](https://msdn.microsoft.com/library/windows/apps/dn278701) を呼び出すことで、システム メディア トランスポート コントロールの UI が新しいメタデータと縮小表示によって更新されます。 [!code-cs[SystemMediaTransportControlsUpdater](./code/SMTCWin10/cs/MainPage.xaml.cs#SnippetSystemMediaTransportControlsUpdater)] 必要に応じて、[**DisplayUpdater**](https://msdn.microsoft.com/library/windows/apps/dn278707) クラスによって公開される [**MusicProperties**](https://msdn.microsoft.com/library/windows/apps/dn278696)、[**ImageProperties**](https://msdn.microsoft.com/library/windows/apps/dn278695)、または [**VideoProperties**](https://msdn.microsoft.com/library/windows/apps/dn278702) オブジェクトの値を設定することにより、システム メディア トランスポート コントロールに表示されるメタデータを手動で更新できます。 [!code-cs[SystemMediaTransportControlsUpdaterManual](./code/SMTCWin10/cs/MainPage.xaml.cs#SystemMediaTransportControlsUpdaterManual)] ## <a name="update-the-system-media-transport-controls-timeline-properties"></a>システム メディア トランスポート コントロールのタイムライン プロパティを更新する システム トランスポート コントロールには、メディア項目の現在の再生位置、開始時刻、終了時刻など、現在再生中のメディア項目のタイムラインに関する情報が表示されます。 システム メディア トランスポート コントロールのタイムライン プロパティを更新するには、新しい [**SystemMediaTransportControlsTimelineProperties**](https://msdn.microsoft.com/library/windows/apps/mt218746) オブジェクトを作成します。 再生中のメディア項目の現在の状態を反映するように、オブジェクトのプロパティを設定します。 [ **SystemMediaTransportControls.UpdateTimelineProperties**](https://msdn.microsoft.com/library/windows/apps/mt218760) を呼び出して、コントロールのタイムラインを更新します。 [!code-cs[UpdateTimelineProperties](./code/SMTCWin10/cs/MainPage.xaml.cs#SnippetUpdateTimelineProperties)] - 再生中の項目のタイムラインをシステム コントロールに表示するには、[**StartTime**](https://msdn.microsoft.com/library/windows/apps/mt218751)、[**EndTime**](https://msdn.microsoft.com/library/windows/apps/mt218747)、および [**Position**](https://msdn.microsoft.com/library/windows/apps/mt218755) の値を指定する必要があります。 - [**MinSeekTime** ](https://msdn.microsoft.com/library/windows/apps/mt218749)と[ **MaxSeekTime** ](https://msdn.microsoft.com/library/windows/apps/mt218748)シークできるユーザーのタイムライン内の範囲を指定できます。 一般的なシナリオとしては、コンテンツ プロバイダーがメディアに広告を含める場合などがあります。 [ **PositionChangeRequest**](https://msdn.microsoft.com/library/windows/apps/mt218755) を発生させるには、[**MinSeekTime**](https://msdn.microsoft.com/library/windows/apps/mt218749) と [**MaxSeekTime**](https://msdn.microsoft.com/library/windows/apps/mt218748) を設定する必要があります。 - システム コントロールは、メディアの再生と同期させておくことをお勧めします。そのためには、再生中にこれらのプロパティを約 5 秒ごとに更新し、一時停止や新しい位置へのシークなど、再生に変更が加えられたときには、再度更新します。 ## <a name="respond-to-player-property-changes"></a>プレーヤーのプロパティの変更に応答する 再生中のメディア項目の状態ではなく、メディア プレーヤー自体の現在の状態に関連した、一連のシステム トランスポート コントロール プロパティがあります。 これらの各プロパティは、ユーザーが関連するコントロールを調整したときに発生するイベントと対応しています。 これらのプロパティとイベントを次に示します。 | プロパティ | event | |---------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------| | [**AutoRepeatMode**](https://msdn.microsoft.com/library/windows/apps/mt218753) | [**AutoRepeatModeChangeRequested**](https://msdn.microsoft.com/library/windows/apps/mt218754) | | [**PlaybackRate**](https://msdn.microsoft.com/library/windows/apps/mt218756) | [**PlaybackRateChangeRequested**](https://msdn.microsoft.com/library/windows/apps/mt218757) | | [**ShuffleEnabled**](https://msdn.microsoft.com/library/windows/apps/mt218758) | [**ShuffleEnabledChangeRequested**](https://msdn.microsoft.com/library/windows/apps/mt218759) |   これらのコントロールの 1 つに対するユーザーの操作を処理するには、最初に、関連付けられているイベントのハンドラーを登録します。 [!code-cs[RegisterPlaybackChangedHandler](./code/SMTCWin10/cs/MainPage.xaml.cs#SnippetRegisterPlaybackChangedHandler)] まず、イベントのハンドラーで、要求された値が有効な予想される範囲内にあることを確認します。 範囲内の場合は、[**MediaElement**](https://msdn.microsoft.com/library/windows/apps/br242926) の対応するプロパティを設定してから、[**SystemMediaTransportControls**](https://msdn.microsoft.com/library/windows/apps/dn278677) オブジェクトの対応するプロパティを設定します。 [!code-cs[PlaybackChangedHandler](./code/SMTCWin10/cs/MainPage.xaml.cs#SnippetPlaybackChangedHandler)] - これらのプレーヤー プロパティ イベントの 1 つが発生するためには、プロパティの初期値を設定する必要があります。 たとえば、[**PlaybackRateChangeRequested**](https://msdn.microsoft.com/library/windows/apps/mt218757) は、[**PlaybackRate**](https://msdn.microsoft.com/library/windows/apps/mt218756) プロパティの値を少なくとも 1 回設定するまでは発生しません。 ## <a name="use-the-system-media-transport-controls-for-background-audio"></a>バックグラウンド オーディオに対してシステム メディア トランスポート コントロールを使う **MediaPlayer** によって提供される自動 SMTC 統合を使用していない場合は、SMTC と手動で統合してバック グラウンド オーディオを有効にする必要があります。 少なくとも、アプリで [**IsPlayEnabled**](https://msdn.microsoft.com/library/windows/apps/dn278714) と [**IsPauseEnabled**](https://msdn.microsoft.com/library/windows/apps/dn278713) を true に設定して、再生ボタンと一時停止ボタンを有効にする必要があります。 アプリは、[**ButtonPressed**](https://msdn.microsoft.com/library/windows/apps/dn278706) イベントも処理する必要があります。 アプリがこれらの要件を満たしていない場合、アプリがバックグラウンドに移動したときにオーディオ再生は停止します。 バックグラウンド オーディオ用に新しい 1 プロセスのモデルを使うアプリは、[**GetForCurrentView**](https://msdn.microsoft.com/library/windows/apps/dn278708) を呼び出して [**SystemMediaTransportControls**](https://msdn.microsoft.com/library/windows/apps/dn278677) のインスタンスを取得する必要があります。 バックグラウンド オーディオ用に従来の 2 プロセスのモデルを使うアプリは、[**BackgroundMediaPlayer.Current.SystemMediaTransportControls**](https://msdn.microsoft.com/library/windows/apps/dn926635) を使ってバックグラウンド プロセスから SMTC にアクセスする必要があります バックグラウンドでのオーディオ再生について詳しくは、「[バックグラウンドでのメディアの再生](background-audio.md)」をご覧ください。 ## <a name="related-topics"></a>関連トピック * [メディア再生](media-playback.md) * [トランスポート コントロールをシステムのメディアと統合します。](integrate-with-systemmediatransportcontrols.md)  * [システムのメディア転送サンプル](https://github.com/Microsoft/Windows-universal-samples/tree/dev/Samples/SystemMediaTransportControls)   ======================= File: windows-apps-src/design/motion/content-transition-animations.md ======================= <filename>windows-apps-src/design/motion/content-transition-animations.md --- Description: コンテンツ切り替えアニメーションを使うと、コンテナーや背景はそのままに、画面のある領域のコンテンツを変更できます。 新しいコンテンツはフェード インします。 既にあるコンテンツを差し替える場合、そのコンテンツはフェード アウトします。 title: コンテンツ切り替えアニメーションのガイドライン ms.assetid: 0188FDB4-E183-466f-8A03-EE3FF5C474B1 template: detail.hbs ms.date: 05/19/2017 ms.topic: article keywords: windows 10, uwp pm-contact: stmoy design-contact: conrwi doc-status: Published ms.localizationpriority: medium ms.openlocfilehash: 096cc0aaa9b0580eb6b45328a3243ba75d82f202 ms.sourcegitcommit: b034650b684a767274d5d88746faeea373c8e34f ms.translationtype: MT ms.contentlocale: ja-JP ms.lasthandoff: 03/06/2019 ms.locfileid: "57649807" --- # <a name="content-transition-animations"></a>コンテンツ切り替えアニメーション コンテンツ切り替えアニメーションを使うと、コンテナーや背景はそのままに、画面のある領域のコンテンツを変更できます。 新しいコンテンツはフェード インします。 既にあるコンテンツを差し替える場合、そのコンテンツはフェード アウトします。 > **重要な API**:[**ContentThemeTransition クラス (XAML)**](https://msdn.microsoft.com/library/windows/apps/br243104) ## <a name="dos-and-donts"></a>推奨と非推奨 - 開始アニメーションは、空のコンテナーに一連の新しい項目を流し込むときに使います。 たとえば、アプリの初期読み込みの直後は、アプリのコンテンツの一部が表示に間に合わない場合があります。 このような場合、コンテンツを表示する準備が整った段階で、コンテンツ切り替えアニメーションを使い、遅れてコンテンツが表示されるようにします。 - あるコンテンツの組み合わせを、画面内の同じコンテナー内に既に存在する別のコンテンツの組み合わせに置き換えるときに、コンテンツ切り替えを使います。 - 新しいコンテンツを画面に表示するときには、一般的なページのフロー (読む方向) とは逆にコンテンツを上に (下から上に) スライドさせます。 - 新しいコンテンツは論理的な流れで配置します。たとえば、最も重要なコンテンツを最後にします。 - 更新対象のコンテンツを含んだコンテナーが複数存在する場合、切り替え効果アニメーションは、間を置かずにすべて同時にトリガーします。 - コンテンツ切り替えアニメーションは、ページの全体が変化する場合には使わないでください。 この場合には、ページ切り替えアニメーションを使います。 - コンテンツの更新のみであれば、コンテンツ切り替えアニメーションは使わないでください。 コンテンツ切り替えアニメーションは、動きを表現するために使います。 更新には、フェード アニメーションを使ってください。 ## <a name="related-articles"></a>関連記事 **開発者向け (XAML)** * [アニメーションの概要](https://msdn.microsoft.com/library/windows/apps/mt187350) * [コンテンツの切り替えをアニメーション化](https://msdn.microsoft.com/library/windows/apps/xaml/jj649426) * [クイック スタート:Library のアニメーションを使用して、UI をアニメーション化](https://msdn.microsoft.com/library/windows/apps/xaml/hh452703) * [**ContentThemeTransition クラス**](https://msdn.microsoft.com/library/windows/apps/br243104)     ======================= File: windows-apps-src/audio-video-camera/image-metadata.md ======================= --- ms.assetid: D5D98044-7221-4C2A-9724-56E59F341AB0 description: この記事では、画像のメタデータ プロパティを読み取ったり書き込んだりする方法のほか、GeotagHelper ユーティリティ クラスを使ってファイルに位置情報タグを設定する方法について説明します。 title: 画像のメタデータ ms.date: 02/08/2017 ms.topic: article keywords: windows 10, uwp ms.localizationpriority: medium ms.openlocfilehash: 2ab1279a8744d6dc9cddc88abaa064058f1259c2 ms.sourcegitcommit: b034650b684a767274d5d88746faeea373c8e34f ms.translationtype: MT ms.contentlocale: ja-JP ms.lasthandoff: 03/06/2019 ms.locfileid: "57631807" --- # <a name="image-metadata"></a>画像のメタデータ この記事では、画像のメタデータ プロパティを読み取ったり書き込んだりする方法のほか、[**GeotagHelper**](https://msdn.microsoft.com/library/windows/apps/dn903683) ユーティリティ クラスを使ってファイルに位置情報タグを設定する方法について説明します。 ## <a name="image-properties"></a>画像のプロパティ ファイルの内容に関連した情報には、[**StorageFile.Properties**](https://msdn.microsoft.com/library/windows/apps/br227225) プロパティから返される [**StorageItemContentProperties**](https://msdn.microsoft.com/library/windows/apps/hh770642) オブジェクトを使ってアクセスできます。 画像に固有のプロパティを取得するには、[**GetImagePropertiesAsync**](https://msdn.microsoft.com/library/windows/apps/hh770646) を呼び出します。 それによって返される [**ImageProperties**](https://msdn.microsoft.com/library/windows/apps/br207718) オブジェクトは、画像のタイトルやキャプチャの日付など、基本的な画像メタデータのフィールドを含んだメンバーを公開します。 [!code-cs[GetImageProperties](./code/ImagingWin10/cs/MainPage.xaml.cs#SnippetGetImageProperties)] さらに広範なファイル メタデータにアクセスするには、一意の文字列識別子で取得できるファイル メタデータ プロパティが集約された Windows プロパティ システムを使います。 文字列のリストを作成し、取得する必要のある各プロパティの識別子を追加してください。 [ **ImageProperties.RetrievePropertiesAsync**](https://msdn.microsoft.com/library/windows/apps/br207732) メソッドは、この文字列のリストを引数として受け取ってキー/値ペアのディクショナリを返します。このディクショナリのキーがプロパティ識別子で、ディクショナリの値がそのプロパティの値になります。 [!code-cs[GetWindowsProperties](./code/ImagingWin10/cs/MainPage.xaml.cs#SnippetGetWindowsProperties)] - Windows のプロパティの完全な一覧 (プロパティごとの識別子と型を含む) については、「[Windows プロパティ](https://msdn.microsoft.com/library/windows/desktop/dd561977)」をご覧ください。 - 一部のプロパティは、特定のファイル コンテナーや特定の画像コーデックでのみサポートされます。 画像の種類ごとのサポートされるメタデータについては、「[フォト メタデータ ポリシー](https://msdn.microsoft.com/library/windows/desktop/ee872003)」をご覧ください。 - サポート対象外のプロパティを取得しようとすると null 値が返される場合があります。返されたメタデータの値を使う前に必ず、null のチェックを行ってください。 ## <a name="geotag-helper"></a>位置情報タグ ヘルパー GeotagHelper は、地理データを含んだ画像へのタグ付けを支援するユーティリティ クラスです。[**Windows.Devices.Geolocation**](https://msdn.microsoft.com/library/windows/apps/br225603) API を直接使って簡単にタグを設定することができます。メタデータの形式を手動で解析したり構築したりする必要はありません。 地理位置情報 API の使用後など、タグの設定対象となる画像の位置情報を表す [**Geopoint**](https://msdn.microsoft.com/library/windows/apps/dn263675) オブジェクトが取得済みで、そのオブジェクトが既に存在する場合は、[**GeotagHelper.SetGeotagAsync**](https://msdn.microsoft.com/library/windows/apps/dn903685) に [**StorageFile**](https://msdn.microsoft.com/library/windows/apps/br227171) と **Geopoint** を渡して呼び出すことで位置情報タグ データを設定できます。 [!code-cs[SetGeoDataFromPoint](./code/ImagingWin10/cs/MainPage.xaml.cs#SnippetSetGeoDataFromPoint)] デバイスの現在位置を使って位置情報タグ データを設定するには、[**Geolocator**](https://msdn.microsoft.com/library/windows/apps/br225534) オブジェクトを新たに作成し、[**GeotagHelper.SetGeotagFromGeolocatorAsync**](https://msdn.microsoft.com/library/windows/apps/dn903686) の引数に **Geolocator** とタグの設定対象となるファイルとを指定して呼び出します。 [!code-cs[SetGeoDataFromGeolocator](./code/ImagingWin10/cs/MainPage.xaml.cs#SnippetSetGeoDataFromGeolocator)] - [ **SetGeotagFromGeolocatorAsync**](https://msdn.microsoft.com/library/windows/apps/dn903686) API を使うには、アプリ マニフェストに**位置情報**デバイス機能を追加する必要があります。 - [ **SetGeotagFromGeolocatorAsync**](https://msdn.microsoft.com/library/windows/apps/dn903686) を呼び出す前に [**RequestAccessAsync**](https://msdn.microsoft.com/library/windows/apps/dn859152) を呼び出し、ユーザーの位置情報をアプリで使うための許可を得ておく必要があります。 - 地理位置情報 API について詳しくは、「[マップと位置情報](https://msdn.microsoft.com/library/windows/apps/mt219699)」をご覧ください。 位置情報タグで示された画像ファイルの地理的位置を表す GeoPoint を取得するには、[**GetGeotagAsync**](https://msdn.microsoft.com/library/windows/apps/dn903684) を呼び出します。 [!code-cs[GetGeoData](./code/ImagingWin10/cs/MainPage.xaml.cs#SnippetGetGeoData)] ## <a name="decode-and-encode-image-metadata"></a>画像メタデータのデコードとエンコード 画像データを操作する最も高度な方法は、[**BitmapDecoder**](https://msdn.microsoft.com/library/windows/apps/br226176) または [BitmapEncoder](bitmapencoder-options-reference.md) を使って、プロパティの読み取りと書き込みをストリーム レベルで行うことです。 これらの操作では、読み取りまたは書き込みの対象データを Windows プロパティを使って指定できるほか、要求するプロパティのパスを Windows Imaging Component (WIC) のメタデータ クエリ言語を使って指定することもできます。 この方法で画像のメタデータを読み取るには、ソース画像ファイル ストリームを使って作成された [**BitmapDecoder**](https://msdn.microsoft.com/library/windows/apps/br226176) が必要です。 この方法については、「[イメージング](imaging.md)」をご覧ください。 デコーダーを取得したら、文字列のリストを作成し、Windows プロパティの識別子文字列または WIC メタデータ クエリを使って、取得する各メタデータ プロパティの新しいエントリを追加します。 特定のプロパティを要求するには、デコーダーの [**BitmapProperties**](https://msdn.microsoft.com/library/windows/apps/br226248) メンバーの [**BitmapPropertiesView.GetPropertiesAsync**](https://msdn.microsoft.com/library/windows/apps/br226250) メソッドを呼び出します。 要求したプロパティが、プロパティ名 (またはパス) とプロパティ値を含んだキー/値ペアのディクショナリとして返されます。 [!code-cs[ReadImageMetadata](./code/ImagingWin10/cs/MainPage.xaml.cs#SnippetReadImageMetadata)] - WIC メタデータ クエリ言語とサポートされるプロパティについては、「[WIC ネイティブ イメージ形式メタデータのクエリ](https://msdn.microsoft.com/library/windows/desktop/ee719904)」をご覧ください。 - メタデータのプロパティの多くは、サポートされる画像の種類に限りがあります。 [**GetPropertiesAsync** ](https://msdn.microsoft.com/library/windows/apps/br226250)イメージがメタデータをまったくサポートしない場合は、デコーダーと 0x88982F81 に関連付けられているイメージで要求されたプロパティの 1 つはサポートされていない場合は、エラー コード 0x88982F41 で失敗します。 これらのエラー コードに関連付けられている定数は WINCODEC\_ERR\_PROPERTYNOTSUPPORTED と WINCODEC\_ERR\_UNSUPPORTEDOPERATION とは、winerror.h ヘッダー ファイルで定義します。 - 特定のプロパティの値が画像に存在するかどうかはわからないので、**IDictionary.ContainsKey** を使って、結果にプロパティが存在するかどうかを確かめたうえでアクセスしてください。 画像のメタデータをストリームに書き込むには、画像の出力ファイルに関連付けられている **BitmapEncoder** が必要です。 設定対象プロパティの値を保持する [**BitmapPropertySet**](https://msdn.microsoft.com/library/windows/apps/hh974338) オブジェクトを作成します。 プロパティの値を表す [**BitmapTypedValue**](https://msdn.microsoft.com/library/windows/apps/hh700687) オブジェクトを作成します。 このオブジェクトでは、値の型を定義する [**PropertyType**](https://msdn.microsoft.com/library/windows/apps/br225871) 列挙型の値およびメンバーとして **object** を使います。 **BitmapTypedValue** を **BitmapPropertySet** に追加したうえで、[**BitmapProperties.SetPropertiesAsync**](https://msdn.microsoft.com/library/windows/apps/br226252) を呼び出すと、エンコーダーがプロパティをストリームに書き込みます。 [!code-cs[WriteImageMetadata](./code/ImagingWin10/cs/MainPage.xaml.cs#SnippetWriteImageMetadata)] - 画像ファイルの種類ごとのサポート対象プロパティについて詳しくは、「[Windows プロパティ](https://msdn.microsoft.com/library/windows/desktop/dd561977)」、「[フォト メタデータ ポリシー](https://msdn.microsoft.com/library/windows/desktop/ee872003)」、「[WIC ネイティブ イメージ形式メタデータのクエリ](https://msdn.microsoft.com/library/windows/desktop/ee719904)」をご覧ください。 - [**SetPropertiesAsync** ](https://msdn.microsoft.com/library/windows/apps/br226252)エンコーダーに関連付けられているイメージで要求されたプロパティの 1 つはサポートされていない場合は、エラー コード 0x88982F41 で失敗します。 ## <a name="related-topics"></a>関連トピック * [イメージング](imaging.md)     ======================= File: windows-apps-src/design/app-settings/guidelines-for-app-settings.md ======================= --- Description: この記事では、アプリ設定を作成し、表示する際のベスト プラクティスについて説明します。 title: アプリ設定のガイドライン ms.assetid: 2D765E90-3FA0-42F5-A5CB-BEDC14C3F60A label: Guidelines template: detail.hbs ms.date: 02/08/2017 ms.topic: article keywords: windows 10, uwp ms.localizationpriority: medium ms.openlocfilehash: a31464d208e8d9abe68703560552c99e5d957463 ms.sourcegitcommit: b034650b684a767274d5d88746faeea373c8e34f ms.translationtype: MT ms.contentlocale: ja-JP ms.lasthandoff: 03/06/2019 ms.locfileid: "57638237" --- # <a name="guidelines-for-app-settings"></a>アプリ設定のガイドライン アプリ設定は、アプリの中でユーザーによるカスタマイズが可能な部分です。この設定は、アプリ設定のページに含まれています。 たとえば、ニュース リーダー アプリのアプリ設定では、表示するニュース ソースや画面に表示する記事の数を指定できる場合があります。また、天気予報アプリのアプリ設定では、温度の既定の計測単位として摂氏または華氏を選ぶことができます。 この記事では、アプリ設定を作成し、表示する際のベスト プラクティスについて説明します。 ## <a name="should-i-include-a-settings-page-in-my-app"></a>アプリに設定ページを含めるかどうか アプリ設定のページに含めるアプリのオプションには、次のようなものがあります。 - アプリの動作に影響するが、頻繁な再調整を必要としない構成オプション。たとえば、天気予報アプリで温度の既定の単位として摂氏または華氏を選ぶ機能、メール アプリでアカウント設定を変更する機能、通知に関する設定、アクセシビリティ オプションなどです。 - 音楽、効果音、配色テーマなど、ユーザーの設定に基づくオプション。 - プライバシー ポリシー、ヘルプ、アプリのバージョン、著作権情報など、頻繁にはアクセスされないアプリ情報。 アプリの通常のワークフローに含まれるコマンド (お絵かきアプリでのブラシ色の変更など) は設定ページに含めません。 コマンド配置について詳しくは、「[コマンド設計の基本](https://msdn.microsoft.com/library/windows/apps/dn958433)」をご覧ください。 ## <a name="general-recommendations"></a>一般的な推奨事項 - 設定ページは簡潔にし、バイナリ (オン/オフ) コントロールを利用します。 [トグル スイッチ](../controls-and-patterns/toggles.md)は、一般に、二者択一の設定に最適とされているコントロールです。 - ユーザーが相互排他的な関連するオプション (5 個まで) の中から 1 つの項目を選ぶことができるようにする場合は、[ラジオ ボタン](../controls-and-patterns/radio-button.md)を使います。 - アプリ設定のページに、すべてのアプリ設定のエントリ ポイントを作成します。 - 設定はシンプルにします。 適切な既定値を定義し、設定の数は最小限にします。 - ユーザーが設定を変更したときは、変更がすぐにアプリに反映されるようにします。 - アプリの一般的なワークフローに関連するコマンドは追加しないでください。 ## <a name="entry-point"></a>エントリ ポイント ユーザーがアプリ設定のページにアクセスする方法は、アプリのレイアウトに基づいている必要があります。 **ナビゲーション ウィンドウ** ナビゲーション ウィンドウ レイアウトの場合、アプリ設定は、選択肢が示されるナビゲーション リストの最後の項目として配置し、下部にピン留めすることをお勧めします。 ![ナビゲーション ウィンドウでのアプリ設定のエントリ ポイント](images/appsettings-entrypoint-navpane.png) **アプリ バー** [アプリ バー](../controls-and-patterns/app-bars.md)またはツール バーを使っている場合、設定のエントリ ポイントを [その他] オーバーフロー メニューの最後の項目として配置します。 設定のエントリ ポイントを簡単に検索できることがアプリで重要となる場合は、オーバーフローではなく、アプリ バーに直接エントリ ポイントを配置します。 ![アプリ バーでのアプリ設定のエントリ ポイント](images/appsettings-entrypoint-tabs.png) **ハブ** ハブ レイアウトを使っている場合は、アプリ設定のエントリ ポイントをアプリ バーの [その他] オーバーフロー メニュー内に配置することをお勧めします。 **タブ/ピボット** タブやピボットのレイアウトでは、アプリ設定のエントリ ポイントをナビゲーション内のトップレベルのいずれかの項目として配置することはお勧めしません。 代わりに、アプリ設定のエントリ ポイントをアプリ バーの [その他] オーバーフロー メニュー内に配置することをお勧めします。 **マスター-詳細** アプリ設定のエントリをマスター/詳細ウィンドウ内の深い位置に配置するのではなく、マスター ウィンドウのトップ レベルに、最後のピン留めされた項目として配置してください。 ## <a name="layout"></a>レイアウト デスクトップの場合でも、モバイルの場合でも、アプリ設定のウィンドウは全画面で開き、ウィンドウ全体に表示されるようにします。 アプリ設定のメニューに 4 つまでの最上位グループが含まれる場合は、それらのグループが 1 列分右下がりで表示されるようにします。 デスクトップ: ![デスクトップにおけるアプリ設定のページのレイアウト](images/appsettings-layout-navpane-desktop.png) モバイル: ![電話におけるアプリ設定のページのレイアウト](images/appsettings-layout-navpane-mobile.png) ## <a name="color-mode-settings"></a>"カラー モード" の設定 アプリでユーザーがアプリのカラー モードを選択できるようにする場合は、"アプリ モードを選ぶ" という見出しを持つ[ラジオ ボタン](../controls-and-patterns/radio-button.md)または[コンボ ボックス](../controls-and-patterns/lists.md#drop-down-lists)を使ってこれらのオプションを表示します。 オプションは次のようになっている必要があります。 - 明るい - 暗い - Windows の既定 また、Windows 設定アプリの [色] ページへのハイパーリンクを追加して、ユーザーが現在の既定のアプリ モードにアクセスして変更できるようにすることもお勧めします。 ハイパーリンク テキストには、"Windows の色の設定" という文字列を使用します。 !["モードを選ぶ" セクション](images/appsettings_mode.png) <!-- <div class="microsoft-internal-note"> Detailed redlines showing preferred text strings for the "Choose a mode" section are available on [UNI](https://uni/DesignDepot.FrontEnd/#/ProductNav/2543/0/dv/?t=Windows%7CControls%7CColorMode&f=RS2). </div> --> ## <a name="about-section-and-feedback-button"></a>バージョン情報セクションとフィードバック ボタン 専用のページとして、または独自のセクションで、アプリに "バージョン情報" セクションを配置することをお勧めします。 "フィードバックを送信する" ためのボタンが必要な場合は、そのボタンを "バージョン情報" を表示するページの下部に配置します。 "法的情報" サブヘッダーの下に、"使用条件" と "プライバシーに関する声明" を配置し (折り返しのあるテキストを使った[ハイパーリンク ボタン](../controls-and-patterns/hyperlinks.md)にする必要があります)、著作権などのその他の法的情報も配置します。 !["バージョン情報" のセクションと "フィードバックを送信する" ためのボタン](images/appsettings-about.png) ## <a name="recommended-page-content"></a>推奨されるページのコンテンツ アプリ設定のページに含める項目の一覧を作成したら、次のガイドラインを考慮してください。 - 類似した設定や関連する設定は、1 つの設定ラベルにまとめます。 - 設定の合計数は、4 つまたは 5 つ以下に制限してください。 - アプリのコンテキストに関係なく、同じ設定を表示します。 いくつかの設定が特定のコンテキストに適合しない場合は、アプリ設定のポップアップでそれらの設定を無効にします。 - 設定のラベルは、わかりやすい 1 単語にします。 たとえば、アカウント関連の設定の場合は、設定の名前を "アカウント設定" ではなく "アカウント" にします。 必要な設定のオプションが 1 つだけで、設定のわかりやすいラベルが思い付かない場合は、"オプション" または "既定" を使います。 - 設定がポップアップではなく直接 Web にリンクされている場合は、[ハイパーリンク](../controls-and-patterns/hyperlinks.md)としてスタイルを設定した "ヘルプ (オンライン)" や "Web フォーラム" など、ユーザーに視覚的なヒントを与えます。 Web への複数のリンクは、1 つの設定を使ってポップアップにまとめることを検討してください。 たとえば、"バージョン情報" の設定では、使用条件、プライバシー ポリシー、アプリのサポートへのリンクを含むポップアップが開くようにします。 - 使用頻度の高い設定にそれぞれ独自のエントリを割り当てられるように、使用頻度の低い設定は 1 つのエントリにまとめます。 情報のみを含むコンテンツやリンクは、"バージョン情報" の設定に配置します。 - [アクセス許可] ウィンドウの機能と重複しないようにします。 このウィンドウは既定で用意されており、その内容を変更することはできません。 - 設定ポップアップへの設定コンテンツの追加 - コンテンツは 1 列で上から下に表示し、必要に応じてスクロールできるようにします。 スクロールの長さは画面の高さの 2 倍までに抑えます。 - アプリ設定では次のコントロールを使います。 - [トグル スイッチ](../controls-and-patterns/toggles.md):ユーザーができるようにするには、オンまたはオフ値を設定します。 - [ラジオ ボタン](../controls-and-patterns/radio-button.md):ユーザー 5 相互に排他的では最大のセットから 1 つの項目を選択できるようにするには、オプションに関連します。 - [テキスト入力ボックス](../controls-and-patterns/text-block.md):ユーザーがテキスト入力をできるようにします。 ユーザーから取得するテキストの種類 (メール、パスワードなど) に応じた種類のテキスト入力ボックスを使います。 - [ハイパーリンク](../controls-and-patterns/hyperlinks.md):アプリ内の別のページまたは外部の web サイトには、ユーザーを誘導します。 ユーザーがハイパーリンクをクリックすると、設定ポップアップは閉じられます。 - [ボタン](../controls-and-patterns/buttons.md):ユーザーが現在の設定のフライアウトを表示したまま、早急な対応を開始をできるようにします。 - 使用できないコントロールがある場合は、説明用のメッセージを追加します。 使用できないコントロールの上に、このメッセージを配置します。 - 設定ポップアップとヘッダーがアニメーション化された後で、コンテンツとコントロールを単一のブロックとしてアニメーション化します。 [ **enterPage**](https://msdn.microsoft.com/library/windows/apps/br212672) または [**EntranceThemeTransition**](https://msdn.microsoft.com/library/windows/apps/br210288) アニメーションを使って、100 ピクセル左のオフセットでコンテンツをアニメーション化します。 - 必要に応じて、コンテンツの整理と明確化の助けになるように、セクション ヘッダー、段落、ラベルを使います。 - 設定を繰り返し表示する必要がある場合は、UI の階層を追加するか、展開/折りたたみモデルを使います。階層の深さは 2 階層までに抑えます。 たとえば、天気予報アプリの都市別の設定では、都市の一覧を表示し、ユーザーが都市をタップしたときに、新しいポップアップを開くか、展開して設定オプションを表示できるようにします。 - コントロールや Web コンテンツの読み込みに時間がかかる場合は、進行状況不定コントロールを使ってユーザーに読み込み中であることを示します。 詳しくは、「[プログレス コントロールのガイドライン](https://msdn.microsoft.com/library/windows/apps/hh465469)」をご覧ください。 - 移動や変更をコミットするためのボタンは使いません。 別のページに移動するにはハイパーリンクを使います。また、ボタンを使って変更をコミットする代わりに、ユーザーが設定ポップアップを閉じたときにアプリ設定の変更を自動的に保存します。 ## <a name="related-articles"></a>関連記事 * [コマンドのデザインの基礎](https://msdn.microsoft.com/library/windows/apps/dn958433) * [プログレス コントロールのガイドライン](https://msdn.microsoft.com/library/windows/apps/hh465469) * [アプリ データの格納と取得](https://msdn.microsoft.com/library/windows/apps/mt299098) * [**EntranceThemeTransition**](https://msdn.microsoft.com/library/windows/apps/br210288) ======================= File: windows-apps-src/porting/wpsl-to-uwp-porting-xaml-and-ui.md ======================= --- description: 宣言的 XAML マークアップの形式で UI を定義する方法は、ユニバーサル Windows プラットフォーム (UWP) アプリには、Windows Phone Silverlight からも非常に変換されます。 title: Windows Phone Silverlight XAML と UI を UWP への移植 ms.assetid: 49aade74-5dc6-46a5-89ef-316dbeabbebe ms.date: 02/08/2017 ms.topic: article keywords: windows 10, uwp ms.localizationpriority: medium ms.openlocfilehash: 869ab9994f10070797fb4b803b1189127d84eadf ms.sourcegitcommit: b034650b684a767274d5d88746faeea373c8e34f ms.translationtype: MT ms.contentlocale: ja-JP ms.lasthandoff: 03/06/2019 ms.locfileid: "57643497" --- # <a name="porting-windowsphone-silverlight-xaml-and-ui-to-uwp"></a>Windows Phone Silverlight XAML と UI を UWP への移植 前のトピックは、「[トラブルシューティング](wpsl-to-uwp-troubleshooting.md)」でした。 宣言的 XAML マークアップの形式で UI を定義する方法は、ユニバーサル Windows プラットフォーム (UWP) アプリには、Windows Phone Silverlight からも非常に変換されます。 システムのリソース キーの参照の更新、いくつかの要素型名の変更、"clr-namespace" から "using" への変更を行うことによって、大きなマークアップ セクションで互換性が得られることがわかります。 プレゼンテーション層のビュー モデルの命令型コード、および UI 要素を操作するコードの大半でも、簡単に移植できます。 ## <a name="a-first-look-at-the-xaml-markup"></a>初めての XAML マークアップ 前のトピックに示した、XAML をコピーする方法と、分離コード ファイルを新しい Windows 10 の Visual Studio プロジェクト。 Visual Studio XAML デザイナーで強調表示され、認識される最初の問題の 1 つは、XAML ファイルのルートで `PhoneApplicationPage` 要素がユニバーサル Windows プラットフォーム (UWP) プロジェクトに対して有効ではないことです。 前のトピックでは、Windows 10 プロジェクトが作成されたときに Visual Studio が生成される XAML ファイルのコピーを保存します。 MainPage.xaml の該当バージョンを開くと、ルートに [**Windows.UI.Xaml.Controls**](https://msdn.microsoft.com/library/windows/apps/br227716) 名前空間の [**Page**](https://msdn.microsoft.com/library/windows/apps/br227503) 型があることに気付きます。 したがって、すべての `<phone:PhoneApplicationPage>` 要素を `<Page>` に変更できます (プロパティ要素の構文を忘れないでください)。また、`xmlns:phone` 宣言は削除できます。 Windows Phone Silverlight 型に対応する UWP 型を検索する一般的な方法を参照することができます[Namespace およびクラス マッピング](wpsl-to-uwp-namespace-and-class-mappings.md)します。 ## <a name="xaml-namespace-prefix-declarations"></a>XAML 名前空間のプレフィックス宣言 ビュー (ビュー モデル インスタンスまたは値コンバーターなど) でカスタム型のインスタンスを使う場合、XAML マークアップに XAML 名前空間のプレフィックス宣言が含まれます。 これらの構文は、Windows Phone Silverlight と UWP で異なります。 例をいくつか紹介します。 ```xml xmlns:ContosoTradingCore="clr-namespace:ContosoTradingCore;assembly=ContosoTradingCore" xmlns:ContosoTradingLocal="clr-namespace:ContosoTradingLocal" ``` "clr-namespace" を "using" に変更し、アセンブリ トークンとセミコロンを削除します (アセンブリが推論されます)。 結果は次のようになります。 ```xml xmlns:ContosoTradingCore="using:ContosoTradingCore" xmlns:ContosoTradingLocal="using:ContosoTradingLocal" ``` システムによって種類が定義されるリソースが存在する場合があります。 ```xml xmlns:System="clr-namespace:System;assembly=mscorlib" /*... */ <System:Double x:Key="FontSizeLarge">40</System:Double> ``` UWP で、"System" プレフィックス宣言を省略し、(既に宣言されている) "x" プレフィックスを代わりに使います。 ```xml <x:Double x:Key="FontSizeLarge">40</x:Double> ``` ## <a name="imperative-code"></a>命令型コード ビュー モデルは、UI の種類を参照する命令型コードが存在する場所の 1 つです。 もう 1 つの場所は、UI 要素を直接操作するコード ビハインド ファイルです。 たとえば、次のようなコード行がまだコンパイルされていないことに気が付くことがあります。 ```csharp return new BitmapImage(new Uri(this.CoverImagePath, UriKind.Relative)); ``` **BitmapImage**では、 **System.Windows.Media.Imaging**名前空間では、Windows Phone の Silverlight、およびを使用して、同じファイルでディレクティブにより**BitmapImage**名前空間なしで使用するには上記のスニペットのように修飾します。 同様の場合に、Visual Studio で型名 (**BitmapImage**) を右クリックし、コンテキスト メニューの **[解決]** コマンドを使って新しい名前空間のディレクティブをファイルに追加できます。 この場合、該当する型が UWP に存在している、[**Windows.UI.Xaml.Media.Imaging**](https://msdn.microsoft.com/library/windows/apps/br243258) 名前空間が追加されます。 **System.Windows.Media.Imaging** の using ディレクティブは削除できます。また、前記のスニペットのようなコードの移植で必要になるのはこれだけです。 完成したときに、すべての Windows Phone Silverlight 名前空間を削除します。 古い名前空間の型を新しい名前空間の同じ型でマッピングするこのような簡単なケースでは、ソース コードに一括変更を加えるために、Visual Studio の **[検索と置換]** コマンドを使うこともできます。 **[解決]** コマンドは、型の新しい名前空間を検索するための効果的な方法です。 別の例として、すべての "System.Windows" を "Windows.UI.Xaml" に置換できます。 これによって基本的には、該当する名前空間を参照するすべての using ディレクティブおよび完全修飾されたすべての型名が移植されます。 古い using ディレクティブをすべて削除し、新しい using ディレクティブを追加したら、Visual Studio の **[using の整理]** コマンドを使ってディレクティブを並べ替えて、未使用のディレクティブを削除できます。 命令型コードの修正がパラメーターの型の変更のみになることもあります。 その他の回では、.NET Api の Windows ランタイム 8.x アプリではなく、UWP Api を使用する必要があります。 識別するためにどの Api がサポートされていると組み合わせてこの移植のガイドの残りの部分を使用して[.NET の Windows ランタイム 8.x アプリの概要](https://msdn.microsoft.com/library/windows/apps/xaml/br230302.aspx)と[Windows ランタイム リファレンス](https://msdn.microsoft.com/library/windows/apps/br211377)します。 また、プロジェクトのビルド段階にただ進むだけであれば、重要でないコードをコメントアウトするか、スタブを挿入できます。 反復し、一度に 1 つの問題と、このセクションでは、次のトピックを参照してください (と前のトピック。[トラブルシューティング](wpsl-to-uwp-troubleshooting.md))、ビルドと実行時の問題はアイロンで転写アウトと、ポートが完了するまでです。 ## <a name="adaptiveresponsive-ui"></a>アダプティブ/応答性の高い UI Windows 10 アプリは、可能性のあるさまざまなデバイスで実行できるため、それぞれに独自の画面サイズと解像度: 紹介だけでなく、アプリを移植する最小限の手順を実行して、それらのデバイスの表示を最適化するように UI を調整します。 アダプティブな Visual State Manager の機能を使って、ウィンドウのサイズを動的に検出し、それに応じてレイアウトを変更できます。その方法を示す例を、Bookstore2 ケース スタディの「[アダプティブ UI](wpsl-to-uwp-case-study-bookstore2.md)」に示します。 ## <a name="alarms-and-reminders"></a>アラームとリマインダー **Alarm** クラスまたは **Reminder** クラスを使うコードは、バックグラウンド タスクを作成、登録して、関連する時間にトーストを表示するために、[**BackgroundTaskBuilder**](https://msdn.microsoft.com/library/windows/apps/br224768) クラスを使って移植します。 「[バックグラウンド処理](wpsl-to-uwp-business-and-data.md)」と「[トースト](#toasts)」をご覧ください。 ## <a name="animation"></a>アニメーション キーフレーム アニメーションと from/to アニメーションに対して推奨される代替機能として、UWP アプリで UWP アニメーション ライブラリが利用できるようになりました。 こうしたアニメーションはスムーズかつ適切に表示されるように設計、調整されているために、組み込みのアプリのように Windows に統合されてアプリが動作します。 参照してください[クイック スタート。Library のアニメーションを使用して、UI をアニメーション化](https://msdn.microsoft.com/library/windows/apps/xaml/hh452703)します。 UWP アプリでキーフレーム アニメーションまたは from/to アニメーションを使う場合、新しいプラットフォームで導入された独立型アニメーションと依存型アニメーションの相違について理解することをお勧めします。 「[アニメーションとメディアの最適化](https://msdn.microsoft.com/library/windows/apps/mt204774)」をご覧ください。 UI スレッドで実行するアニメーション (たとえば、レイアウト プロパティをアニメーションするもの) は、依存型アニメーションと呼ばれ、新しいプラットフォーム上での実行時に、次の 2 つのいずれかを行わなければ無効になります。 いずれも、異なるプロパティ ([**RenderTransform**](https://msdn.microsoft.com/library/windows/apps/br208980) など) をアニメーションするためにターゲットを変更できるので、独立型にできます。 アニメーション要素で `EnableDependentAnimation="True"` を設定することによって、スムーズな実行を保証できないアニメーションを実行する意図を確認できます。 新しいアニメーションの作成のために Blend for Visual Studio を使っている場合、必要であればこのプロパティが自動的に設定されます。 ## <a name="back-button-handling"></a>"戻る" ボタンの処理 Windows 10 アプリでは、[戻る] ボタンを処理する 1 つのアプローチを使用することができ、すべてのデバイスで動作します。 モバイル デバイスでは、このボタンはデバイス上の静電容量式のボタンまたはシェル内のボタンとして提供されます。 デスクトップ デバイスでは、アプリ内で戻るナビゲーションが可能な場合には常にアプリのクロムにボタンを追加します。このボタンは、ウィンドウ表示されたアプリのタイトル バーまたはタブレット モードのタスク バーに表示されます。 "戻る" ボタンのイベントはすべてのデバイス ファミリに共通するユニバーサルな概念であり、ハードウェアまたはソフトウェアに実装されるボタンは同じ [**BackRequested**](https://msdn.microsoft.com/library/windows/apps/dn893596) イベントを発生させます。 次の例は、すべてのデバイス ファミリについて機能し、同じ処理をすべてのページに適用し、ナビゲーションを確認する必要がない場合 (未保存の変更に関する警告を表示するなど) に適しています。 ```csharp // app.xaml.cs protected override void OnLaunched(LaunchActivatedEventArgs e) { [...] Windows.UI.Core.SystemNavigationManager.GetForCurrentView().BackRequested += App_BackRequested; rootFrame.Navigated += RootFrame_Navigated; } private void RootFrame_Navigated(object sender, NavigationEventArgs e) { Frame rootFrame = Window.Current.Content as Frame; // Note: On device families that have no title bar, setting AppViewBackButtonVisibility can safely execute // but it will have no effect. Such device families provide a back button UI for you. if (rootFrame.CanGoBack) { Windows.UI.Core.SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = Windows.UI.Core.AppViewBackButtonVisibility.Visible; } else { Windows.UI.Core.SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = Windows.UI.Core.AppViewBackButtonVisibility.Collapsed; } } private void App_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e) { Frame rootFrame = Window.Current.Content as Frame; if (rootFrame.CanGoBack) { rootFrame.GoBack(); } } ``` プログラムを使ったアプリの終了に関しても、すべてのデバイス ファミリに対する単一のアプローチがあります。 ```csharp Windows.UI.Xaml.Application.Current.Exit(); ``` ## <a name="binding-and-compiled-bindings-with-xbind"></a>バインドおよび {x:Bind} でコンパイル済みのバインド 次に、バインドに関するトピックをいくつか示します。 - UI 要素から "データ" (つまり、ビュー モデルのプロパティとコマンド) へのバインド - UI 要素から別の UI 要素へのバインド - 監視可能なビュー モデルの記述 (つまり、プロパティ値の変更時およびコマンドの可用性の変更時に通知が発生します) こうした要素はすべて、引き続きサポートされていますが、名前空間には違いがあります。 たとえば、**System.Windows.Data.Binding** は [**Windows.UI.Xaml.Data.Binding**](https://msdn.microsoft.com/library/windows/apps/br209820) にマップし、**System.ComponentModel.INotifyPropertyChanged** は [**Windows.UI.Xaml.Data.INotifyPropertyChanged**](https://msdn.microsoft.com/library/windows/apps/br209899) にマップして、**System.Collections.Specialized.INotifyPropertyChanged** は [**Windows.UI.Xaml.Interop.INotifyCollectionChanged**](https://msdn.microsoft.com/library/windows/apps/hh702001) にマップします。 Windows Phone Silverlight アプリ バーやアプリ バーのボタンは、UWP アプリにバインドできません。 アプリ バーとそのボタンを構築し、プロパティとローカライズされた文字列にバインドして、イベントを処理する命令型コードを使う場合もあります。 その場合、プロパティとコマンドにバインドされた宣言型マークアップ、および静的なリソース参照によって置き換えることで、該当する命令型コードを移植し、アプリの安全性と保守性を段階的に高めることができます。 Visual Studio または Blend for Visual Studio を使って、他の XAML 要素と同様に、UWP アプリ バーのボタンのバインドとスタイル設定を行うことができます。 UWP アプリでは、使う型名は [**CommandBar**](https://msdn.microsoft.com/library/windows/apps/dn279427) および [**AppBarButton**](https://msdn.microsoft.com/library/windows/apps/dn279244) であることに注意してください。 ただし、現在 UWP アプリのバインド関連の機能には以下の制限があります。 - データ エントリ検証と [**IDataErrorInfo**](https://msdn.microsoft.com/library/system.componentmodel.idataerrorinfo.aspx) インターフェイスおよび [**INotifyDataErrorInfo**](https://msdn.microsoft.com/library/system.componentmodel.inotifydataerrorinfo.aspx) インターフェイスには、サポートが組み込まれていません。 - [**バインド**](https://msdn.microsoft.com/library/windows/apps/br209820)クラスでは、Windows Phone Silverlight で使用可能な拡張の書式設定プロパティは含まれません。 ただし、[**IValueConverter**](https://msdn.microsoft.com/library/windows/apps/br209903) を実装してカスタム書式設定を提供することはできます。 - [ **IValueConverter**](https://msdn.microsoft.com/library/windows/apps/br209903) メソッドは、言語文字列を、[**CultureInfo**](https://msdn.microsoft.com/library/system.globalization.cultureinfo.aspx) オブジェクトではなくパラメーターとして受け取ります。 - [ **CollectionViewSource**](https://msdn.microsoft.com/library/windows/apps/br209833) クラスには、並べ替えとフィルター処理、さまざまなグループへの作業のグループ化のサポートが組み込まれていません。 詳しくは、「[データ バインディングの詳細](https://msdn.microsoft.com/library/windows/apps/mt210946)」と[データ バインディングのサンプルに関するページ](https://go.microsoft.com/fwlink/p/?linkid=226854)をご覧ください。 同じバインド機能はサポートされても大きく、Windows 10 の新しいオプションを提供して、バインドと呼ばれるメカニズムにより高いコンパイル バインドは、{X:bind} マークアップ拡張機能を使用します。 参照してください[データ バインディング。XAML データ バインディングの新しい拡張機能として、アプリのパフォーマンスを向上させる](https://channel9.msdn.com/Events/Build/2015/3-635)、および[X:bind サンプル](https://go.microsoft.com/fwlink/p/?linkid=619989)します。 ## <a name="binding-an-image-to-a-view-model"></a>ビュー モデルへの画像のバインド [ **Image.Source**](https://msdn.microsoft.com/library/windows/apps/br242760) プロパティは、ビュー モデルの [**ImageSource**](https://msdn.microsoft.com/library/windows/apps/br210107) 型であるどのプロパティにもバインドできます。 このようなプロパティは、Windows Phone Silverlight アプリでの一般的な実装を次に示します。 ```csharp // this.BookCoverImagePath contains a path of the form "/Assets/CoverImages/one.png". return new BitmapImage(new Uri(this.CoverImagePath, UriKind.Relative)); ``` UWP アプリでは、ms-appx [URI スキーム](https://msdn.microsoft.com/library/windows/apps/jj655406)を使います。 残るコードを変更せずに維持するために、**System.Uri** コンストラクターの異なるオーバーロードを使って、ベース URI に ms-appx URI スキームを格納し、パスの残る部分を追加できます。 次に例を示します。 ```csharp // this.BookCoverImagePath contains a path of the form "/Assets/CoverImages/one.png". return new BitmapImage(new Uri(new Uri("ms-appx://"), this.CoverImagePath)); ``` これによって、ビュー モデル、画像のパス プロパティのパス値、XAML マークアップのバインドの残る部分をすべて、まったく変更せずに維持できます。 ## <a name="controls-and-control-stylestemplates"></a>コントロールとコントロール スタイル/テンプレート Windows Phone Silverlight アプリで定義されているコントロールを使用して、 **Microsoft.Phone.Controls**名前空間と**System.Windows.Controls**名前空間。 XAML UWP アプリは、[**Windows.UI.Xaml.Controls**](https://msdn.microsoft.com/library/windows/apps/br227716) 名前空間で定義されたコントロールを使います。 アーキテクチャと、UWP での XAML コントロールの設計はほぼ同じ Windows Phone の Silverlight コントロールとして。 ただし、使用可能なコントロール セットの向上と Windows アプリとの一体化のために、若干の変更が加えられています。 具体的な例をいくつか紹介します。 | コントロール名 | [Change] | |--------------|--------| | ApplicationBar | [Page.TopAppBar](https://msdn.microsoft.com/library/windows/apps/hh702575) プロパティです。 | | ApplicationBarIconButton | UWP の相当要素は [Glyph](https://msdn.microsoft.com/library/windows/apps/dn279538) プロパティです。 PrimaryCommands は CommandBar のコンテンツ プロパティです。 XAML パーサーは、コンテンツ プロパティの値として要素の内部 xml を解釈します。 | | ApplicationBarMenuItem | UWP の相当要素は、メニュー項目のテキストに設定された [AppBarButton.Label](https://msdn.microsoft.com/library/windows/apps/dn279261) です。 | | ContextMenu (Windows Phone Toolkit 内) | 単一選択ポップアップの場合は、[Flyout](https://msdn.microsoft.com/library/windows/apps/dn279496) を使います。 | | ControlTiltEffect.TiltEffect クラス | UWP アニメーション ライブラリのアニメーションは、共通のコントロールの既定のスタイルに組み込まれています。 「[ポインター操作のアニメーション化](https://msdn.microsoft.com/library/windows/apps/xaml/jj649432)」をご覧ください。 | | グループ化されたデータを含む LongListSelector | 連携して使用できる、2 つの方法で Windows Phone Silverlight LongListSelector 関数。 まず、キーによってグループ化したデータを表示できます、たとえば、名前の一覧を最初の文字によってグループ化できます。 次に、2 つのセマンティック ビュー (名前などの項目のグループ化されたリストと、最初の文字などのグループ キー自体に限られるリスト) の間で "ズーム" できます。 UWP では、[リスト ビュー コントロールとグリッド ビュー コントロールのガイドライン](https://msdn.microsoft.com/library/windows/apps/mt186889)に従ってグループ化されたデータを表示できます。 | | フラット データを含む LongListSelector | パフォーマンス上の理由から、非常に長いリストは、の場合は、フラットなにグループ化されたデータに対しても Windows Phone Silverlight リスト ボックスではなく LongListSelector お勧めします。 UWP アプリでは、データのグループ化が可能であるかどうかにかかわらず、長い項目リストで [GridView](https://msdn.microsoft.com/library/windows/apps/br242705) を使うことをお勧めします。 | | Panorama | Windows Phone Silverlight パノラマ コントロールにマップ、 [Windows ランタイム 8.x アプリ内のハブ コントロールに関するガイドライン](https://msdn.microsoft.com/library/windows/apps/dn449149)とハブの制御に関するガイドライン。 <br/> Panorama コントロールは、最後のセクションから最初のセクションに折り返され、背景画像はセクションを基準とした視差効果で移動します。 [Hub](https://msdn.microsoft.com/library/windows/apps/dn251843) セクションは折り返されず、視差効果は使われません。 | | Pivot | Windows Phone Silverlight ピボット コントロールに相当する UWP [Windows.UI.Xaml.Controls.Pivot](https://msdn.microsoft.com/library/windows/apps/dn608241)します。 これはすべてのデバイス ファミリで利用できます。 | **注**   PointerOver 表示状態は、カスタム スタイルまたはテンプレートで Windows Phone Silverlight アプリではなく、Windows 10 アプリに関連します。 別の理由でなぜ既存のカスタム スタイルまたはテンプレートが適切でない Windows 10 を含む、アプリを使用しているシステム リソースのキーの使用、表示状態とパフォーマンスの改善に Windows 10 の既定のスタイルに加えられたセットへの変更/テンプレート。 Windows 10 用のコントロールの既定のテンプレートの新しいコピーを編集し、スタイルとテンプレートのカスタマイズを再適用するをお勧めします。 UWP のコントロールについて詳しくは、「[機能別コントロール](https://msdn.microsoft.com/library/windows/apps/mt185405)」、「[コントロールの一覧](https://msdn.microsoft.com/library/windows/apps/mt185406)」、「[コントロールのガイドライン](https://msdn.microsoft.com/library/windows/apps/dn611856)」をご覧ください。 ## <a name="design-language-in-windows10"></a>Windows 10 でのデザイン言語 Windows Phone Silverlight アプリと Windows 10 アプリのデザイン言語では、いくつか違いがあります。 詳しくは、「[Design](https://developer.microsoft.com/en-us/windows/apps/design)」(UWP アプリの設計) をご覧ください。 デザイン言語に変更が加えられていますが、設計原則は維持されています。細部にまで注意を払いながら、簡潔さを追求しています。そのために、クロムよりもコンテンツを優先し、視覚要素を大幅に減らし、真のデジタル領域を常に意識しています。また、視覚的な階層の利用 (特に文字体裁に対して)、グリッド内でのデザイン、滑らかなアニメーションを使ったエクスペリエンスの実現も行っています。 ## <a name="localization-and-globalization"></a>ローカリゼーションとグローバリゼーション ローカライズされた文字列の場合、UWP アプリ プロジェクトで、.resx ファイルを Windows Phone Silverlight プロジェクトから使用すること再ことができます。 ファイルをコピーしてプロジェクトに追加し、検索メカニズムによって既定で検索されるように名前を Resources.resw に変更します **[ビルド アクション]** を **[PRIResource]** に設定し、**[出力ディレクトリにコピー]** を **[コピーしない]** に設定します。 次に、XAML 要素で **x:Uid** 属性を指定することにより、マークアップで文字列を使うことができます。 参照してください[クイック スタート。文字列リソースを使用して](https://msdn.microsoft.com/library/windows/apps/xaml/hh965329)します。 Windows Phone Silverlight アプリの使用、 **CultureInfo**アプリをグローバル化を支援するクラス。 UWP アプリは、MRT (Modern Resource Technology) を使います。これによって、実行時および Visual Studio デザイン サーフェイスで、アプリ リソース (ローカライズ、サイズ調整、テーマ) の動的な読み込みが可能になります。 詳しくは、「[ファイル、データ、グローバリゼーションのガイドライン](https://msdn.microsoft.com/library/windows/apps/dn611859)」をご覧ください。 「[**ResourceContext.QualifierValues**](https://msdn.microsoft.com/library/windows/apps/br206071)」トピックでは、デバイス ファミリのリソースを選ぶ要因に基づいてデバイス ファミリ固有のリソースを読み込む方法について説明しています。 ## <a name="media-and-graphics"></a>メディアとグラフィックス UWP のメディアとグラフィックスに関する説明では、Windows の設計原則で、視覚的な複雑さや混乱を含めて、不用なあらゆるものの極度の簡略化を促している点に注意してください。 Windows 設計は、明確かつ明瞭な視覚効果、文字体裁、モーションによって特徴付けられます。 アプリが同じ原則に従えば、組み込みアプリのように振る舞うことができます。 Windows Phone Silverlight には、 **RadialGradientBrush**これは、UWP に存在しない型が他の[**ブラシ**](/uwp/api/Windows.UI.Xaml.Media.Brush)の種類します。 場合によっては、ビットマップでも同様の効果を得ることができます。 [Microsoft DirectX](https://msdn.microsoft.com/library/windows/desktop/ee663274) および XAML C++ UWP では、Direct2D により[放射状グラデーションのブラシを作成](https://msdn.microsoft.com/library/windows/desktop/dd756679)できることに注意してください。 Windows Phone Silverlight には、 **System.Windows.UIElement.OpacityMask**プロパティがプロパティは、UWP のメンバーではない [**UIElement** ](https://msdn.microsoft.com/library/windows/apps/br208911)型。 場合によっては、ビットマップでも同様の効果を得ることができます。 また、[Microsoft DirectX](https://msdn.microsoft.com/library/windows/desktop/ee663274) および XAML C++ UWP アプリでは、Direct2D により[不透明マスクを作成](https://msdn.microsoft.com/library/windows/desktop/ee329947)できます。 ただし、**OpacityMask** の一般的な使用事例の 1 つに、淡色テーマと濃色テーマの両方に適合する単一のビットマップを使うことがあります。 ベクター グラフィック (次に示す円グラフなど) では、テーマに対応するシステム ブラシを使うことができます。 ただし、テーマに対応するビットマップ (次に示すチェック マークなど) を作成するには、別のアプローチが必要です。 ![テーマに対応するビットマップ](images/wpsl-to-uwp-case-studies/wpsl-to-uwp-theme-aware-bitmap.png) Windows Phone Silverlight アプリケーションでは、技法はビットマップの形式) の「アルファのマスクを使用すると、 **OpacityMask**の**四角形**前景ブラシで塗りつぶされます。 ```xml <Rectangle Fill="{StaticResource PhoneForegroundBrush}" Width="26" Height="26"> <Rectangle.OpacityMask> <ImageBrush ImageSource="/Assets/wpsl_check.png"/> </Rectangle.OpacityMask> </Rectangle> ``` UWP アプリにこれを移植する最も簡単な方法は、[**BitmapIcon**](https://msdn.microsoft.com/library/windows/apps/dn279306) を使うことです。 ```xml <BitmapIcon UriSource="Assets/winrt_check.png" Width="21" Height="21"/> ``` ここでは、winrt\_check.png は wpsl と同様、ビットマップの形式でアルファ マスク\_check.png と同じファイルで非常にうまく可能性があります。 ただし、winrt のいくつかのさまざまなサイズを提供することがあります\_check.png は異なるスケーリング要因を使用します。 この詳細および **Width** 値と **Height** 値の変更については、このトピックの「[表示ピクセルと有効ピクセル、視聴距離、スケール ファクター](#view-or-effective-pixels-viewing-distance-and-scale-factors)」をご覧ください。 淡色テーマと濃色テーマのビットマップ形式に違いがある場合に適切であるより一般的なアプローチは、2 つの画像アセット (一方が淡色テーマ用の濃色の前景、他方が濃色テーマ用の淡色の前景) を使うことです。 このビットマップのアセットのセットの名前を付ける方法については、次を参照してください。[言語、スケール、およびその他の修飾子のためのリソースを調整](../app-resources/tailor-resources-lang-scale-contrast.md)します。 イメージ ファイル セットに正しい名前を付けた後、次のようにしてルート名を使って抽象内で参照できます。 ```xml <Image Source="Assets/winrt_check.png" Stretch="None"/> ``` Windows Phone silverlight で、 **UIElement.Clip**プロパティで表現できる任意の図形を指定できます、 **Geometry**は通常の XAML マークアップでシリアル化されると、 **StreamGeometry**ミニ言語。 UWP では、[**Clip**](https://msdn.microsoft.com/library/windows/apps/br208919) プロパティの型は [**RectangleGeometry**](https://msdn.microsoft.com/library/windows/apps/br210259) です。したがって、四角形の領域のみを切り取ることができます。 ミニ言語を使った四角形の定義を許可することは寛容すぎる場合もあります。 したがって、マークアップ内の切り取り領域を移植するには、**Clip** 属性構文を置き換え、次のようなプロパティ要素構文にします。 ```xml <UIElement.Clip> <RectangleGeometry Rect="10 10 50 50"/> </UIElement.Clip> ``` [Microsoft DirectX](https://msdn.microsoft.com/library/windows/desktop/dd756654) アプリおよび XAML C++ UWP アプリで Direct2D により[レイヤー内でマスクとして任意のジオメトリを使用](https://msdn.microsoft.com/library/windows/desktop/ee663274)できることに注意してください。 ## <a name="navigation"></a>ナビゲーション Windows Phone Silverlight アプリでのページに移動するときは、Uniform Resource Identifier (URI) のアドレス指定スキームを使用します。 ```csharp NavigationService.Navigate(new Uri("/AnotherPage.xaml", UriKind.Relative)/*, navigationState*/); ``` UWP アプリでは、[**Frame.Navigate**](https://msdn.microsoft.com/library/windows/apps/br242694) メソッドを呼び出し、(ページの XAML マークアップ定義の **x:Class** 属性によって定義された) 移動先ページの種類を指定します。 ```csharp // In a page: this.Frame.Navigate(typeof(AnotherPage)/*, parameter*/); // In a view model, perhaps inside an ICommand implementation: var rootFrame = Windows.UI.Xaml.Window.Current.Content as Windows.UI.Xaml.Controls.Frame; rootFrame.Navigate(typeof(AnotherPage)/*, parameter*/); ``` WMAppManifest.xml では、Windows Phone Silverlight アプリのスタートアップ ページを定義します。 ```xml <DefaultTask Name="_default" NavigationPage="MainPage.xaml" /> ``` UWP アプリでは、起動ページを定義するために命令型コードを使います。 次の例は、そのための方法を示す App.xaml.cs からのコードです。 ```csharp if (!rootFrame.Navigate(typeof(MainPage), e.Arguments)) ``` URI マッピングとフラグメント ナビゲーションは URI ナビゲーションの手法であり、したがって URI に基づく UWP ナビゲーションには該当しません。 URI マッピングは、ページが異なるフォルダー、したがって異なる相対パスに移動したときに脆弱性と保守性の問題が生じる URI 文字列によるターゲット ページの特定における弱い型の特性への対応として用意されているものです。 UWP アプリでは、厳密に型指定され、コンパイラで確認される型ベースのナビゲーションを使っており、URI マッピングの解決における問題がありません。 フラグメント ナビゲーションの使用事例は、ページでコンテンツの特定のフラグメントにビューをスクロールするか、または表示できるように、ターゲット ページにコンテキストを渡すことです。 [ **Navigate**](https://msdn.microsoft.com/library/windows/apps/br242694) メソッドの呼び出し時にナビゲーション パラメーターを渡すことでも、これは実現できます。 詳しくは、「[ナビゲーション](https://msdn.microsoft.com/library/windows/apps/mt187344)」をご覧ください。 ## <a name="resource-key-reference"></a>リソースのキーの参照 デザイン言語は、Windows 10 の進化してきたと、特定のシステム スタイルが変更されたため、多くのシステム リソースのキーが削除または名前が変更されました。 Visual Studio の XAML マークアップ エディターでは、解決できないリソース キーへの参照が強調表示されます。 たとえば XAML マークアップ エディターでは、スタイル キー `PhoneTextNormalStyle` への参照の下に赤い波線が引かれます。 これを修正しない場合、エミュレーターかデバイスに展開しようとしたときにアプリが直ちに終了します。 したがって、XAML マークアップの正確性に関する作業に着手することが重要です。 また、そのような問題を検出するために Visual Studio が優れたツールであることがわかります。 この後の「[テキスト](#text)」もご覧ください。 ## <a name="status-bar-system-tray"></a>ステータス バー (システム トレイ) システム トレイ (`shell:SystemTray.IsVisible` により XAML マークアップで設定される) は、現在ではステータス バーと呼ばれており、既定で示されます。 [ **Windows.UI.ViewManagement.StatusBar.ShowAsync**](https://msdn.microsoft.com/library/windows/apps/dn610343) メソッドと [**HideAsync**](https://msdn.microsoft.com/library/windows/apps/dn610339) メソッドを呼び出すことによって、表示するかどうかを命令型コードで制御できます。 ## <a name="text"></a>Text テキスト (または文字体裁) は UWP アプリの重要な要素です。移植するときには、ビューの視覚的なデザインが新しいデザイン言語に適合するように、ビューの視覚的なデザインを再検討することが必要になる場合があります。 次の図を使って、利用可能な UWP の **TextBlock** システム スタイルを見つけます。 使用して Windows Phone Silverlight スタイルに対応するものを検索します。 または、ユニバーサル スタイルを作成しに Windows Phone Silverlight のシステム スタイルからプロパティをコピーすることができます。 ![Windows 10 アプリのシステム TextBlock スタイル](images/label-uwp10stylegallery.png) Windows 10 アプリに関するシステム TextBlock スタイル Windows Phone Silverlight アプリでは、既定のフォント ファミリは Segoe WP が。 Windows 10 アプリでは、既定のフォント ファミリは Segoe UI です。 この結果、アプリでのフォント メトリックの表示が異なる可能性があります。 Windows Phone Silverlight テキストの外観を再現する場合は、プロパティを使用して、独自のメトリックを設定できます[ **LineHeight** ](https://msdn.microsoft.com/library/windows/apps/br209671)と[ **LineStackingStrategy**](https://msdn.microsoft.com/library/windows/apps/br244362). 詳しくは、「[フォントのガイドライン](https://msdn.microsoft.com/library/windows/apps/hh700394.aspx)」と「[UWP アプリの設計](https://developer.microsoft.com/en-us/windows/apps/design)」をご覧ください。 ## <a name="theme-changes"></a>テーマの変更 Windows Phone Silverlight アプリでは、既定のテーマは、既定で暗いです。 Windows 10 デバイスでは、既定のテーマが変更されたが App.xaml で要求されたテーマを宣言することによって使用されるテーマを制御することができます。 たとえば、すべてのデバイスで濃色テーマを使うには、`RequestedTheme="Dark"` をルートの Application 要素に追加します。 ## <a name="tiles"></a>タイル UWP アプリのタイルでは、いくつかの違いはライブ タイル for Windows Phone Silverlight アプリと同様の動作があります。 たとえば、セカンダリ タイルを作成するために **Microsoft.Phone.Shell.ShellTile.Create** メソッドを呼び出すコードは、[**SecondaryTile.RequestCreateAsync**](https://msdn.microsoft.com/library/windows/apps/br230606) を呼び出すように移植する必要があります。 ここで例を示します前に、と後、最初に、Windows Phone の Silverlight バージョン。 ```csharp var tileData = new IconicTileData() { Title = this.selectedBookSku.Title, WideContent1 = this.selectedBookSku.Title, WideContent2 = this.selectedBookSku.Author, SmallIconImage = this.SmallIconImageAsUri, IconImage = this.IconImageAsUri }; ShellTile.Create(this.selectedBookSku.NavigationUri, tileData, true); ``` 次に相当する UWP の要素を示します。 ```csharp var tile = new SecondaryTile( this.selectedBookSku.Title.Replace(" ", string.Empty), this.selectedBookSku.Title, this.selectedBookSku.ArgumentString, this.IconImageAsUri, TileSize.Square150x150); await tile.RequestCreateAsync(); ``` **Microsoft.Phone.Shell.ShellTile.Update** メソッドまたは **Microsoft.Phone.Shell.ShellTileSchedule** クラスによりタイルを更新するコードは、[**TileUpdateManager**](https://msdn.microsoft.com/library/windows/apps/br208622) クラス、[**TileUpdater**](https://msdn.microsoft.com/library/windows/apps/br208628) クラス、[**TileNotification**](https://msdn.microsoft.com/library/windows/apps/br208616) クラス、[**ScheduledTileNotification**](https://msdn.microsoft.com/library/windows/apps/hh701637) クラスを使うように移植する必要があります。 タイル、トースト、バッジ、バナー、通知について詳しくは、「[タイルの作成](https://msdn.microsoft.com/library/windows/apps/xaml/hh868260)」と「[タイル、バッジ、トースト通知の操作](https://msdn.microsoft.com/library/windows/apps/xaml/hh868259)」をご覧ください。 UWP タイルに使うビジュアル アセットのサイズの仕様については、「[タイルとトーストのビジュアル資産](https://msdn.microsoft.com/library/windows/apps/hh781198)」をご覧ください。 ## <a name="toasts"></a>トースト **Microsoft.Phone.Shell.ShellToast** クラスによりトーストを表示するコードは、[**ToastNotificationManager**](https://msdn.microsoft.com/library/windows/apps/br208642) クラス、[**ToastNotifier**](https://msdn.microsoft.com/library/windows/apps/br208653) クラス、[**ToastNotification**](https://msdn.microsoft.com/library/windows/apps/br208641) クラス、[**ScheduledToastNotification**](https://msdn.microsoft.com/library/windows/apps/br208607) クラスを使うように移植する必要があります。 モバイル デバイスでは、"トースト" の利用者向け用語が "バナー" であることに注意してください。 「[タイル、バッジ、トースト通知の操作](https://msdn.microsoft.com/library/windows/apps/xaml/hh868259)」をご覧ください。 ## <a name="view-or-effective-pixels-viewing-distance-and-scale-factors"></a>表示ピクセルと有効ピクセル、視聴距離、スケール ファクター Windows Phone Silverlight アプリと Windows 10 アプリは、サイズと実際の物理サイズから UI 要素のレイアウトおよびデバイスの解像度に抽象化され、方法が異なります。 Windows Phone Silverlight アプリでは、ビュー (ピクセル) を使用して、これを行います。 Windows 10 でビューのピクセルの概念が変換されて有効ピクセルの。 有効ピクセルの用語の説明、有効ピクセルが何をするものなのか、および有効ピクセルで使うことができる追加の値について、以下に示します。 一般的な考えとは異なり、"解像度" という用語はピクセル密度の測定値を表しており、ピクセル数ではありません。 "有効解像度" は、画像またはグリフを構成する物理ピクセルを解決して、デバイスの視聴距離と物理ピクセル サイズでの目視による相違の度合を取得する方法です (物理ピクセル サイズの逆数であるピクセル密度)。 有効解像度は、ユーザー中心であるために、エクスペリエンスの構築に適したメトリックです。 すべての要因について理解し、UI 要素のサイズを制御することによって、ユーザーのエクスペリエンスを適切なものにすることができます。 Windows Phone Silverlight アプリにすべての電話の画面は、正確に 480 ビュー ピクセル、例外なしに物理ピクセルの数に関係なく、画面もそのピクセル密度や物理サイズは何です。 つまり、**イメージ**を持つ要素`Width="48"`正確に 10 分の Windows Phone Silverlight アプリを実行できる任意の電話の画面の幅の 1 になります。 Windows 10 のアプリに*いない*すべてのデバイスは、いくつかのケースは、有効ピクセルの数を固定します。 これは、UWP アプリが広範なデバイスで実行できることから、おそらく明白です。 デバイスによって、有効ピクセルの幅の値が異なります。その範囲は、320 epx (最小のデバイス) から 1024 epx (一般的なサイズのモニター)、またはそれ以上のさらに広い幅になります。 これまでと同様に、自動的にサイズ調整される要素と動的レイアウト パネルを引き続き使うことで十分に対応できます。 ただし、場合によっては、UI 要素のプロパティを XAML マークアップで固定サイズに設定することがあります。 スケール ファクターは、アプリが実行されているデバイスやユーザーが行った表示設定に応じて、アプリに自動的に適用されます。 スケール ファクターによって、さまざまな幅の画面サイズでユーザーに対してほぼ一定サイズのタッチ (または読み取り) ターゲットを提示するように、すべての UI 要素を固定サイズで維持できます。 また、動的レイアウトと共に使うことで、UI は単にさまざまなデバイスで光学的なスケーリングを行うだけでなく、利用可能な領域に合わせて適切な量のコンテンツを表示するために必要となる処理も実行します。 480 固定幅であったため、携帯電話サイズの画面では、およびその値 (ピクセル) が有効ピクセルで通常より小さいビューで、0.8 の倍数で、Windows Phone Silverlight アプリのマークアップ内の任意の次元を乗算する、一般には。 すべてのディスプレイで最適なアプリのエクスペリエンスが実現できるように、一連のサイズで各ビットマップ アセットを作成し、各アセットが特定のスケール ファクターに適合するように設定することをお勧めします。 ただし、100% スケール、200% スケール、および 400% スケール (この優先順位で) でアセットを作成するほうが、多くの場合、すべての中間スケール ファクターで適切な結果を得ることができます。 **注**  場合、何らかの理由ですることはできません、1 つ以上のサイズでアセットを作成し、100% スケール アセットを作成します。 Microsoft Visual Studio では、UWP アプリの既定のプロジェクト テンプレートには 1 つのサイズのみのブランド アセット (タイル イメージとロゴ) が用意されていますが、これらは 100% のスケールではありません。 独自のアプリのアセットを作成する場合は、このセクションに示したガイドラインに従って、100%、200%、400% のサイズを用意し、アセット パックを使います。 複雑なアートワークがある場合は、さらに多くのサイズに対応したアセットが必要になることがあります。 ベクター アートを使って作業を始める場合は、どのようなスケール ファクターでも高品質なアセットを比較的簡単に生成できます。 すべてのスケール ファクターをサポートしようとするが、Windows 10 アプリのスケール ファクターの完全な一覧が 100%、125%、150%、200%、250%、300%、および 400% にはお勧めしません。 すべてのスケール ファクターのアセットを提供した場合、ストアでは、各デバイスに合った適切なサイズのアセットが選ばれ、それらのアセットのみがダウンロードされます。 ストアでは、デバイスの DPI に基づいて、ダウンロードするアセットが選ばれます。 詳しくは、「[UWP アプリ用レスポンシブ デザイン 101](https://msdn.microsoft.com/library/windows/apps/dn958435)」をご覧ください。 ## <a name="window-size"></a>ウィンドウ サイズ UWP アプリでは、命令型コードを使って最小サイズ (幅と高さ) を指定できます。 既定の最小サイズは 500 x 320 epx で、このサイズは受け入れられる最も小さいサイズでもあります。 受け入れられる最も大きいサイズは 500 x 500 epx です。 ```csharp Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().SetPreferredMinSize (new Size { Width = 500, Height = 500 }); ``` 次のトピックは、「[入出力、デバイス、アプリ モデルの移植](wpsl-to-uwp-input-and-sensors.md)」です。 ## <a name="related-topics"></a>関連トピック * [Namespace およびクラスのマッピング](wpsl-to-uwp-namespace-and-class-mappings.md) ======================= File: windows-apps-src/design/input/custom-text-input.md ======================= <reponame>joannaleecy/windows-uwp-pr.ja-jp --- Description: Windows.UI.Text.Core 名前空間の基本的なテキスト API によって、ユニバーサル Windows プラットフォーム (UWP) アプリは、Windows デバイスでサポートされている任意のテキスト サービスからテキスト入力を受け取ることができます。 title: カスタム テキスト入力の概要 ms.assetid: 58F5F7AC-6A4B-45FC-8C2A-942730FD7B74 label: Custom text input template: detail.hbs keywords: キーボード, テキスト, 基本的なテキスト, カスタム テキスト, テキスト サービス フレームワーク, 入力, ユーザー操作 ms.date: 02/08/2017 ms.topic: article ms.localizationpriority: medium ms.openlocfilehash: dfb2a5203d2a8e5c497fa427c6a2a7ed5fe2302d ms.sourcegitcommit: b034650b684a767274d5d88746faeea373c8e34f ms.translationtype: MT ms.contentlocale: ja-JP ms.lasthandoff: 03/06/2019 ms.locfileid: "57638707" --- # <a name="custom-text-input"></a>カスタム テキスト入力 [ **Windows.UI.Text.Core**](https://msdn.microsoft.com/library/windows/apps/dn958238) 名前空間の基本的なテキスト API によって、ユニバーサル Windows プラットフォーム (UWP) アプリは、Windows デバイスでサポートされている任意のテキスト サービスからテキスト入力を受け取ることができます。 この API は、アプリがテキスト サービスの詳細を認識している必要がないという点で、[テキスト サービス フレームワーク](https://msdn.microsoft.com/library/windows/desktop/ms629032) API に似ています。 これにより、アプリは、任意の言語で、キーボード、音声、ペンなどの任意の入力の種類からテキストを受け取ることができます。 > **重要な API**:[**Windows.UI.Text.Core**](https://msdn.microsoft.com/library/windows/apps/dn958238)、 [ **CoreTextEditContext**](https://msdn.microsoft.com/library/windows/apps/dn958158) ## <a name="why-use-core-text-apis"></a>基本的なテキスト API を使う理由 多くのアプリでは、テキストの入力や編集には XAML や HTML のテキスト ボックス コントロールで十分です。 ただし、ワード プロセッシング アプリなど、アプリでテキストの複雑なシナリオを処理する場合は、柔軟なカスタム テキスト編集コントロールが必要になる可能性があります。 [ **CoreWindow**](https://msdn.microsoft.com/library/windows/apps/br208225) キーボード API を使ってテキスト編集コントロールを作成できますが、これらは、東アジアの言語をサポートするために必要なコンポジション ベースのテキスト入力を受け取る方法を提供しません。 カスタム テキスト編集コントロールを作成する必要がある場合は、代わりに [**Windows.UI.Text.Core**](https://msdn.microsoft.com/library/windows/apps/dn958238) API を使います。 これらの API は、任意の言語でのテキスト入力の処理において高い柔軟性を実現するように設計されており、アプリに最適なテキスト エクスペリエンスを提供できます。 基本的なテキスト API に組み込まれているテキスト入力および編集コントロールは、Windows デバイスでの既存のすべてのテキスト入力方式からテキスト入力を受け取ることができます。これには、[テキスト サービス フレームワーク](https://msdn.microsoft.com/library/windows/desktop/ms629032) ベースの入力方式エディター (IME) や PC での手書き入力、モバイル デバイスでの WordFlow キーボード (自動修正、予測入力、ディクテーションを提供する) が含まれます。 ## <a name="architecture"></a>Architecture テキスト入力システムの単純な例を次に示します。 - "アプリケーション" は、基本的なテキスト API を使って構築されたカスタム編集コントロールをホストする UWP アプリを表します。 - [ **Windows.UI.Text.Core**](https://msdn.microsoft.com/library/windows/apps/dn958238) API は、Windows 経由でのテキスト サービスとの通信を容易にします。 テキスト編集コントロールとテキスト サービス間の通信は、主に [**CoreTextEditContext**](https://msdn.microsoft.com/library/windows/apps/dn958158) オブジェクトによって処理されます。このオブジェクトが通信を容易にするメソッドとイベントを提供します。 ![基本的なテキストのアーキテクチャ図](images/coretext/architecture.png) ## <a name="text-ranges-and-selection"></a>テキスト範囲と選択範囲 編集コントロールはテキスト入力用の領域を提供し、ユーザーはこの領域の任意の場所でテキストを編集できることを期待しています。 ここでは、基本的なテキスト API で使用されるテキスト配置システムについて説明します。また、範囲と選択範囲がこのシステムでどのように表現されるかについても説明します。 ### <a name="application-caret-position"></a>アプリケーションのカーソル位置 基本的なテキスト API で使用されるテキスト範囲は、カーソル位置の観点で表されます。 "アプリケーション カーソル位置 (ACP)" は、次に示すように、カーソルの直前にあるテキスト ストリームの先頭からの文字数を示す 0 から始まる数値です。 ![テキスト ストリームの例の図](images/coretext/stream-1.png) ### <a name="text-ranges-and-selection"></a>テキスト範囲と選択範囲 テキスト範囲と選択範囲は、次の 2 つのフィールドが含まれる [**CoreTextRange**](https://msdn.microsoft.com/library/windows/apps/dn958201) 構造体で表されます。 | フィールド | データの種類 | 説明 | |------------------------|---------------------------------------------------------------------------|----------------------------------------------------------------------------------| | **StartCaretPosition** | **数** \[JavaScript\] | **System.Int32** \[.NET\] | **int32** \[C++\] | 範囲の開始位置は、最初の文字の直前の ACP です。 | | **EndCaretPosition** | **数** \[JavaScript\] | **System.Int32** \[.NET\] | **int32** \[C++\] | 範囲の終了位置は、最後の文字の直後の ACP です。 |   たとえば、範囲を前に示したテキスト範囲の\[0、5\] 「こんにちは」という単語を指定します。 **StartCaretPosition** は、常に **EndCaretPosition** 以下である必要があります。 範囲\[5, 0\]が無効です。 ### <a name="insertion-point"></a>挿入ポイント 現在のカーソル位置は挿入ポイントとも呼ばれ、**StartCaretPosition** を **EndCaretPosition** と等しくなるように設定することによって表されます。 ### <a name="noncontiguous-selection"></a>連続しない選択範囲 一部の編集コントロールでは、連続しない選択範囲がサポートされます。 たとえば、Microsoft Office アプリでは任意の複数の選択範囲がサポートされ、多くのソース コード エディターでは列の選択がサポートされています。 ただし、基本的なテキスト API では連続しない選択範囲はサポートされません。 編集コントロールは、1 つ連続した選択範囲のみをレポートする必要があります。これは通常、連続しない選択範囲のアクティブな下位範囲です。 たとえば、次のようなテキスト ストリームがあるとします。 ![テキスト ストリームの図の例](images/coretext/stream-2.png)は 2 つあります。\[0、1\]と\[6, 11\]します。 エディット コントロールを報告する必要があります。 1 つだけいずれか\[0, 1\]または\[6, 11\]します。 ## <a name="working-with-text"></a>テキストの操作 [ **CoreTextEditContext**](https://msdn.microsoft.com/library/windows/apps/dn958158) クラスの [**TextUpdating**](https://msdn.microsoft.com/library/windows/apps/dn958176) イベント、[**TextRequested**](https://msdn.microsoft.com/library/windows/apps/dn958175) イベント、[**NotifyTextChanged**](https://msdn.microsoft.com/library/windows/apps/dn958172) メソッドによって、Windows と編集コントロールとの間でのテキスト フローを実現できます。 編集コントロールは、ユーザーがキーボード、音声、IME などのテキスト入力方式を操作したときに生成される [**TextUpdating**](https://msdn.microsoft.com/library/windows/apps/dn958176) イベントによってテキストを受け取ります。 テキストをコントロールに貼り付けるなどの方法で、編集コントロールでテキストを変更する場合、[**NotifyTextChanged**](https://msdn.microsoft.com/library/windows/apps/dn958172) を呼び出して Windows に通知する必要があります。 テキスト サービスが新しいテキストを必要とする場合、[**TextRequested**](https://msdn.microsoft.com/library/windows/apps/dn958175) イベントが発生します。 **TextRequested** イベント ハンドラーで、新しいテキストを提供する必要があります。 ### <a name="accepting-text-updates"></a>テキストの更新の受け付け 編集コントロールでは、通常、テキストの更新要求を受け付ける必要があります。これらは、ユーザーが入力するテキストを表しているためです。 [ **TextUpdating**](https://msdn.microsoft.com/library/windows/apps/dn958176) イベント ハンドラーでは、編集コントロールの次の操作が想定されています。 1. [ **CoreTextTextUpdatingEventArgs.Text**](https://msdn.microsoft.com/library/windows/apps/dn958236) で指定されたテキストを、[**CoreTextTextUpdatingEventArgs.Range**](https://msdn.microsoft.com/library/windows/apps/dn958234) で指定された位置に挿入します。 2. [ **CoreTextTextUpdatingEventArgs.NewSelection**](https://msdn.microsoft.com/library/windows/apps/dn958233) で指定された位置に選択範囲を配置します。 3. [ **CoreTextTextUpdatingEventArgs.Result**](https://msdn.microsoft.com/library/windows/apps/dn958235) を [**CoreTextTextUpdatingResult.Succeeded**](https://msdn.microsoft.com/library/windows/apps/dn958237) に設定することによって、更新が成功したことをシステムに通知します。 たとえば、これは、ユーザーが "d" を入力する前の編集コントロールの状態です。 挿入ポイントがある\[10, 10\]します。 ![テキスト ストリームの図の例](images/coretext/stream-3.png)"d"、ユーザーを入力すると、 [ **TextUpdating** ](https://msdn.microsoft.com/library/windows/apps/dn958176)に次のイベントは[ **CoreTextTextUpdatingEventArgs**](https://msdn.microsoft.com/library/windows/apps/dn958229)データ。 - [**範囲**](https://msdn.microsoft.com/library/windows/apps/dn958234) = \[10, 10\] - [**テキスト**](https://msdn.microsoft.com/library/windows/apps/dn958236) "d"を = - [**NewSelection**](https://msdn.microsoft.com/library/windows/apps/dn958233) = \[11、11\] 編集コントロールで、指定された変更を適用し、[**Result**](https://msdn.microsoft.com/library/windows/apps/dn958235) を **Succeeded** に設定します。 変更が適用された後のコントロールの状態は、次のようになります。 ![テキスト ストリームの例の図](images/coretext/stream-4.png) ### <a name="rejecting-text-updates"></a>テキストの更新の拒否 要求された範囲が編集コントロールの変更してはいけない領域にある場合、テキストの更新を適用できないことがあります。 この場合、変更を適用しないでください。 代わりに、[**CoreTextTextUpdatingEventArgs.Result**](https://msdn.microsoft.com/library/windows/apps/dn958235) を [**CoreTextTextUpdatingResult.Failed**](https://msdn.microsoft.com/library/windows/apps/dn958237) に設定することによって、更新が失敗したことをシステムに通知します。 たとえば、電子メール アドレスのみを受け付ける編集コントロールがあるとします。 電子メール アドレスにスペースを含めることはできないため、スペースは拒否する必要があります。そのため、Space キーについて [**TextUpdating**](https://msdn.microsoft.com/library/windows/apps/dn958176) イベントが発生した場合は、編集コントロールで単に [**Result**](https://msdn.microsoft.com/library/windows/apps/dn958235) を **Failed** に設定する必要があります。 ### <a name="notifying-text-changes"></a>テキストの変更の通知 テキストの貼り付けや自動修正などが行われた場合に、編集コントロールのテキストが変更されることがあります。 このような場合、[**NotifyTextChanged**](https://msdn.microsoft.com/library/windows/apps/dn958172) を呼び出すことによって、これらの変更をテキスト サービスに通知する必要があります。 たとえば、これは、ユーザーが "World" を貼り付ける前の編集コントロールの状態です。 挿入ポイントがある\[6、6\]します。 ![テキスト ストリームの図の例](images/coretext/stream-5.png)貼り付けの操作し、次のテキスト編集コントロールが最終的します。 ![テキスト ストリームの図の例](images/coretext/stream-4.png)このような場合を呼び出す必要があります[ **NotifyTextChanged** ](https://msdn.microsoft.com/library/windows/apps/dn958172)これらの引数で。 - *modifiedRange* = \[6、6\] - *newLength* = 5 - *newSelection* = \[11、11\] 1 つまたは複数の [**TextRequested**](https://msdn.microsoft.com/library/windows/apps/dn958175) イベントが発生し、これを処理することによって、テキスト サービスが操作しているテキストを更新します。 ### <a name="overriding-text-updates"></a>テキストの更新の上書き 編集コントロールで、自動修正機能を提供するために、テキストの更新を上書きすることが必要になる場合があります。 たとえば、短縮形を正式なつづりにする修正機能を提供する編集コントロールがあるとします。 ユーザーが Space キーを押して修正機能をトリガーする前の編集コントロールの状態は、次のようになっています。 挿入ポイントがある\[3、3\]します。 ![テキスト ストリームの図の例](images/coretext/stream-6.png)space キーと対応するユーザーが押した[ **TextUpdating** ](https://msdn.microsoft.com/library/windows/apps/dn958176)イベントが発生します。 編集コントロールは、テキストの更新を受け付けます。 修正が完了する直前の編集コントロールの状態は、次のようになります。 挿入ポイントがある\[4, 4\]します。 ![テキスト ストリームの図の例](images/coretext/stream-7.png)の外部、 [ **TextUpdating** ](https://msdn.microsoft.com/library/windows/apps/dn958176)イベント ハンドラーでは、編集コントロールは、次の修正。 修正が完了した後の編集コントロールの状態は、次のようになります。 挿入ポイントがある\[5, 5\]します。 ![テキスト ストリームの図の例](images/coretext/stream-8.png)このような場合を呼び出す必要があります[ **NotifyTextChanged** ](https://msdn.microsoft.com/library/windows/apps/dn958172)これらの引数で。 - *modifiedRange* = \[1、2\] - *newLength* = 2 - *newSelection* = \[5, 5\] 1 つまたは複数の [**TextRequested**](https://msdn.microsoft.com/library/windows/apps/dn958175) イベントが発生し、これを処理することによって、テキスト サービスが操作しているテキストを更新します。 ### <a name="providing-requested-text"></a>要求されたテキストの提供 テキスト サービスでは、自動修正や予測入力などの機能を提供する場合、正しいテキストがあることが重要です。特に、ドキュメントの読み込みなどから編集コントロールに既に存在しているテキストや、前のセクションで説明したように編集コントロールによって挿入されたテキストについて重要です。 そのため、[**TextRequested**](https://msdn.microsoft.com/library/windows/apps/dn958175) イベントが発生するたびに、現在編集コントロール内にあり、指定された範囲のテキストを提供する必要があります。 [ **CoreTextTextRequest**](https://msdn.microsoft.com/library/windows/apps/dn958221) 内の [**Range**](https://msdn.microsoft.com/library/windows/apps/dn958227) が、編集コントロールでそのまま格納できない範囲を指定する場合があります。 たとえば、[**TextRequested**](https://msdn.microsoft.com/library/windows/apps/dn958175) イベントの発生時に **Range** が編集コントロールのサイズよりも大きい場合や、**Range** の最後が範囲外である場合です。 このような場合は、何か適切な範囲を返す必要があります。通常、これは要求された範囲のサブセットです。 ## <a name="related-articles"></a>関連記事 **サンプル** * [カスタム コントロールの編集サンプル](https://go.microsoft.com/fwlink/?linkid=831024)   **サンプルのアーカイブ** * [XAML テキスト編集のサンプル](https://go.microsoft.com/fwlink/p/?LinkID=251417) ======================= File: windows-apps-src/porting/desktop-to-uwp-run-desktop-app-converter.md ======================= --- Description: Desktop Converter App を実行して、Windows デスクトップ アプリケーション (Win32、WPF、Windows フォームなど) をパッケージ化します。 Search.Product: eADQiWindows 10XVcnh title: Desktop App Converter を使用してアプリをパッケージ化する (デスクトップ ブリッジ) ms.date: 08/21/2018 ms.topic: article keywords: windows 10, uwp ms.assetid: 74c84eb6-4714-4e12-a658-09cb92b576e3 ms.localizationpriority: medium ms.openlocfilehash: 392c8c181906e9e403f2204689b5e0406ea0f914 ms.sourcegitcommit: b034650b684a767274d5d88746faeea373c8e34f ms.translationtype: MT ms.contentlocale: ja-JP ms.lasthandoff: 03/06/2019 ms.locfileid: "57652547" --- # <a name="package-a-desktop-application-using-the-desktop-app-converter"></a>パッケージ、Desktop App Converter を使用してデスクトップ アプリケーション [Desktop App Converter を入手する](https://aka.ms/converter) Desktop App Converter (DAC) は、分散など、Microsoft Store を使用してサービスの最新の Windows 機能と統合するデスクトップ アプリケーション用のパッケージを作成します。 Win32 アプリや.NET 4.6.1 を使用して作成されたアプリも対象になります。 ![DAC アイコン](images/desktop-to-uwp/dac.png) このツールの名前には "Converter" という用語が含まれますが、実は、アプリの変換は行いません。 アプリケーションは変更されません。 しかし、DACは、パッケージ ID を持ち多くの WinRT API を呼び出すことができる Windows アプリ パッケージを生成します。 このパッケージは、開発コンピューターで Add-AppxPackage という PowerShell コマンドレットを使ってインストールすることができます。 このコンバーターは、コンバーターのダウンロードに含まれるクリーンな状態の基本イメージを使って、分離された Windows 環境でデスクトップ インストーラーを実行します。 デスクトップ インストーラーが作成するすべてのレジストリとファイル システムの I/O がキャプチャされ、出力の一部としてパッケージ化されます。 >[!IMPORTANT] >(それ以外の場合は、デスクトップ ブリッジと呼ばれます) デスクトップ アプリケーションの Windows アプリ パッケージを作成する機能は Windows 10 バージョン 1607 で導入され、Windows 10 Anniversary Update (10.0; を対象とするプロジェクトでのみ使用できます。ビルド 14393) または Visual Studio の今後のリリース。 > [!NOTE] > Microsoft Virtual Academy から公開されている、<a href="https://mva.microsoft.com/en-US/training-courses/developers-guide-to-the-desktop-bridge-17373?l=oZG0B1WhD_8406218965/">このシリーズ</a>の短いビデオをご覧ください。 これらのビデオでは、Desktop App Converter を使用する一般的な方法が紹介されています。 ## <a name="the-dac-does-more-than-just-generate-a-package-for-you"></a>DAC が行うのはパッケージの生成だけではありません 他にも以下のような処理を実行できます。 **Windows 10 Creators Update します。** :heavy_check_mark:プレビュー ハンドラー、サムネイル ハンドラー、プロパティ ハンドラー、ファイアウォール規則、URL フラグを自動的に登録する。 :heavy_check_mark:ファイルの種類のマッピングを自動的に登録する。これによりユーザーは、エクスプローラーの **[種類]** 列を使ってファイルをグループ化できるようになります。 :heavy_check_mark:公開 COM サーバーを登録する。 **Windows 10 Anniversary Update 以降** :heavy_check_mark:アプリをテストできるように、パッケージに自動的に署名する。 :heavy_check_mark:パッケージ アプリと Microsoft Store の要件に照らしてアプリケーションを検証します。 オプションの完全な一覧については、このガイドの「[パラメーター リファレンス](#command-reference)」セクションをご覧ください。 パッケージを作成する準備ができたら、始めましょう。 ## <a name="first-prepare-your-application"></a>まず、アプリケーションを準備します アプリケーションのパッケージの作成を開始する前に、このガイドを確認します。[デスクトップ アプリケーションをパッケージ化するための準備](desktop-to-uwp-prepare.md)します。 ## <a name="make-sure-that-your-system-can-run-the-converter"></a>システムでコンバーターを実行できることを確認する システムが以下の要件を満たしていることを確認します。 * Windows 10 Anniversary Update (10.0.14393.0 以降) Pro または Enterprise エディション * 64 ビット (x64) プロセッサ * ハードウェア支援による仮想化 * Second Level Address Translation (SLAT) * [Windows 10 用 Windows ソフトウェア開発キット (SDK)](https://go.microsoft.com/fwlink/?linkid=821375) ## <a name="start-the-desktop-app-converter"></a>Desktop App Converter を起動する 1. [Desktop App Converter](https://aka.ms/converter)をダウンロードおよびインストールします。 2. 管理者として Desktop App Converter を実行します。 ![DAC を管理者として実行する](images/desktop-to-uwp/run-converter.png) コンソール ウィンドウが開きます。 コマンドを実行するには、このコンソール ウィンドウを使います。 ## <a name="set-a-few-things-up-apps-with-installers-only"></a>必要な設定を行う (インストーラーがあるアプリのみ) 進んで、次のセクションに、アプリケーションは、インストーラーを持っていない場合。 1. オペレーティング システムのバージョン番号を特定します。 そのためには、**[ファイル名を指定して実行]** ダイアログ ボックスで「**winver**」と入力し、**[OK]** をクリックします。 ![winver](images/desktop-to-uwp/winver.png) **[Windows のバージョン情報]** ダイアログ ボックスに Windows ビルドのバージョンが表示されます。 ![Windows 10 のバージョン](images/desktop-to-uwp/win-10-version.png) 2. 適切な [Desktop App Converter 基本イメージ](https://aka.ms/converterimages)をダウンロードします。 ファイル名に含まれるバージョン番号が Windows ビルドのバージョン番号と一致していることを確認してください。 >[!IMPORTANT] > ビルド番号を使用している場合**15063**、そのビルドのマイナー バージョン以上になるは **.483** (例。**15063.540**) をダウンロードすることを確認、 **UPDATE.wim-BaseImage-15063**ファイル。 そのビルドのマイナー バージョンが **.483** 未満である場合は、**BaseImage-15063.wim** ファイルをダウンロードします。 このベース ファイルの互換性のないバージョンを既にセットアップしている場合は、修正することができます。 その方法については、この[ブログの投稿](https://blogs.msdn.microsoft.com/appconsult/2017/08/04/desktop-app-converter-fails-on-windows-10-15063-483-and-later-how-to-solve-it/)をご覧ください。 3. ダウンロードしたファイルを後で見つけることができるように、コンピューター上の適切な場所に置きます。 4. Desktop App Converter を起動したときに表示されるコンソール ウィンドウで、コマンド ```Set-ExecutionPolicy bypass``` を実行します。 5. コマンド ```DesktopAppConverter.exe -Setup -BaseImage.\BaseImage-1XXXX.wim -Verbose``` を実行してコンバーターをセットアップします。 6. 画面の指示に従って、コンピューターを再起動します。 コンバーターによって基本イメージが展開されると、コンソール ウィンドウに状態メッセージが表示されます。 状態メッセージが表示されない場合は、任意のキーを押します。 これにより、コンソール ウィンドウの内容が更新されます。 ![コンソール ウィンドウに表示された状態メッセージ](images/desktop-to-uwp/bas-image-setup.png) 基本イメージが完全に展開されたら、次のセクションに進みます。 ## <a name="package-an-app"></a>アプリをパッケージ化する アプリをパッケージ化するには、Desktop App Converter を起動したときに開くコンソール ウィンドウで ``DesktopAppConverter.exe`` コマンドを実行します。 パラメーターを使用して、アプリケーションのパッケージの名前、発行者、およびバージョン番号を指定します。 > [!NOTE] > 使用して、パッケージとパブリッシャーの名前を取得するには、Microsoft Store でアプリ名に予約した場合[パートナー センター](https://partner.microsoft.com/dashboard)します。 アプリを他のシステムにサイドローディング展開する場合は、独自の名前を指定できます。ただし、選択する発行元名は、アプリへの署名に使用する証明書の名前と一致する必要があります。 ### <a name="a-quick-look-at-command-parameters"></a>コマンド パラメーターの確認 必要なパラメーターは次のとおりです。 ```CMD DesktopAppConverter.exe -Installer <String> -Destination <String> -PackageName <String> -Publisher <String> -Version <Version> ``` 各パラメーターについて詳しくは、[こちら](#command-reference)をご覧ください。 ### <a name="examples"></a>例 アプリをパッケージ化する一般的な方法のいくつかを以下に示します。 * [パッケージ インストーラー (.msi) ファイルがあるアプリケーション](#installer-conversion) * [セットアップの実行可能ファイルがあるアプリケーションをパッケージ化します。](#setup-conversion) * [インストーラーがないアプリケーションをパッケージ化します。](#no-installer-conversion) * [アプリをパッケージ化、アプリ、署名およびストアに提出できるように準備](#optional-parameters) <a id="installer-conversion" /> #### <a name="package-an-application-that-has-an-installer-msi-file"></a>パッケージ インストーラー (.msi) ファイルがあるアプリケーション ``Installer`` パラメーターでインストーラー ファイルを指定します。 ```cmd DesktopAppConverter.exe -Installer C:\Installer\MyAppSetup.msi -Destination C:\Output\MyApp -PackageName "MyApp" -Publisher "CN=MyPublisher" -Version 0.0.0.1 ``` > [!IMPORTANT] > ここで留意すべき重要なことが 2 つあります。 まず、インストーラーは独立したフォルダーに配置し、そのインストーラーに関連するファイルだけを同じフォルダーに配置してください。 コンバーターは、このフォルダーの内容をすべて、分離された Windows 環境にコピーします。 <br> 次に、パートナー センターでは、id を数字で始まる場合、パッケージに割り当てられる場合、確認で渡すことも、 <i>- AppId</i>パラメーター、およびそのパラメーターの値としては、(後にピリオドを区切り文字) 文字列サフィックスのみを使用します。 **ビデオ** <iframe src="https://mva.microsoft.com/en-US/training-courses-embed/developers-guide-to-the-desktop-bridge-17373/Demo-Convert-an-Application-That-Has-an-MSI-Installer-Kh1UU2WhD_7106218965" width="636" height="480" allowFullScreen frameBorder="0"></iframe> インストーラーに、従属ライブラリやフレームワークのインストーラーが含まれている場合、少し異なる方法で整理する必要があります。 [複数のインストーラーとデスクトップ ブリッジの連結に関する記事](https://blogs.msdn.microsoft.com/appconsult/2017/09/11/chaining-multiple-installers-with-the-desktop-app-converter/)をご覧ください。 <a id="setup-conversion" /> #### <a name="package-an-application-that-has-a-setup-executable-file"></a>セットアップの実行可能ファイルがあるアプリケーションをパッケージ化します。 ``Installer`` パラメーターを使って、セットアップの実行可能ファイルを指定します。 ```cmd DesktopAppConverter.exe -Installer C:\Installer\MyAppSetup.exe -InstallerArguments "/S" -Destination C:\Output\MyApp -PackageName "MyApp" -Publisher "CN=MyPublisher" -Version 0.0.0.1 ``` >[!IMPORTANT] >パートナー センターによって id が数字で始まる場合、パッケージに割り当てられる場合に渡すことも確認、 <i>- AppId</i>パラメーター、およびそのパラメーターの値としては、(後にピリオドを区切り文字) 文字列サフィックスのみを使用します。 ``InstallerArguments`` パラメーターは省略可能なパラメーターです。 ただし、Desktop App Converter のには、インストーラーを無人モードで実行する必要があります、ためには、アプリケーションがサイレント フラグをサイレント実行する必要がある場合に使用する必要があります。 ``/S`` フラグは非常に一般的なサイレント フラグですが、セットアップ ファイルを作成するために使用したインストーラー テクノロジによっては、使用するフラグが異なる場合もあります。 **ビデオ** <iframe src="https://mva.microsoft.com/en-US/training-courses-embed/developers-guide-to-the-desktop-bridge-17373/Demo-Convert-an-Application-That-Has-a-Setup-exe-Installer-amWit2WhD_5306218965" width="636" height="480" allowFullScreen frameBorder="0"></iframe> <a id="no-installer-conversion" /> #### <a name="package-an-application-that-doesnt-have-an-installer"></a>インストーラーがないアプリケーションをパッケージ化します。 この例では、使用、``Installer``アプリケーション ファイルのルート フォルダーを指定するパラメーター。 アプリの実行可能ファイルを指定するには、`AppExecutable` パラメーターを使用します。 ```cmd DesktopAppConverter.exe -Installer C:\Installer\MyApp\ -AppExecutable MyApp.exe -Destination C:\Output\MyApp -PackageName "MyApp" -Publisher "CN=MyPublisher" -Version 0.0.0.1 ``` >[!IMPORTANT] >パートナー センターによって id が数字で始まる場合、パッケージに割り当てられる場合に渡すことも確認、 <i>- AppId</i>パラメーター、およびそのパラメーターの値としては、(後にピリオドを区切り文字) 文字列サフィックスのみを使用します。 **ビデオ** <iframe src="https://mva.microsoft.com/en-US/training-courses-embed/developers-guide-to-the-desktop-bridge-17373/Demo-Convert-a-No-Installer-Application-agAXF2WhD_3506218965" width="636" height="480" allowFullScreen frameBorder="0"></iframe> <a id="optional-parameters" /> #### <a name="package-an-app-sign-the-app-and-run-validation-checks-on-the-package"></a>アプリをパッケージ化し、アプリに署名して、パッケージに対して検証チェックを実行する この例は、ローカル テストでアプリケーションへの署名およびパッケージ アプリと Microsoft Store の要件に照らしてアプリケーションを検証する方法を示しています点を除いて最初の 1 つに似ています。 ```cmd DesktopAppConverter.exe -Installer C:\Installer\MyAppSetup.exe -InstallerArguments "/S" -Destination C:\Output\MyApp -PackageName "MyApp" -Publisher "CN=MyPublisher" -Version 0.0.0.1 -MakeAppx -Sign -Verbose -Verify ``` >[!IMPORTANT] >パートナー センターによって id が数字で始まる場合、パッケージに割り当てられる場合に渡すことも確認、 <i>- AppId</i>パラメーター、およびそのパラメーターの値としては、(後にピリオドを区切り文字) 文字列サフィックスのみを使用します。 ``Sign``パラメーター証明書を生成し、それを使用してアプリケーションに署名します。 アプリを実行するには、生成された証明書をインストールする必要があります。 その方法については、このガイドの「[パッケージ アプリを実行する](#run-app)」セクションをご覧ください。 検証でくアプリケーションを使用して、``Verify``パラメーター。 ### <a name="a-quick-look-at-optional-parameters"></a>省略可能なパラメーターの確認 ``Sign`` パラメーターと ``Verify`` パラメーターは省略可能です。 他にも多数の省略可能なパラメーターがあります。 よく使用される省略可能なパラメーターを以下に示します。 ```CMD [-ExpandedBaseImage <String>] [-AppExecutable <String>] [-AppFileTypes <String>] [-AppId <String>] [-AppDisplayName <String>] [-AppDescription <String>] [-PackageDisplayName <String>] [-PackagePublisherDisplayName <String>] [-MakeAppx] [-LogFile <String>] [<CommonParameters>] ``` これらについて詳しくは、次のセクションをご覧ください。 <a id="command-reference" /> ### <a name="parameter-reference"></a>パラメーター リファレンス ここでは、Desktop App Converter を実行するときに使用できるパラメーターの完全な一覧をカテゴリ別に示します。 * [セットアップ](#setup-params) * [変換](#conversion-params) * [パッケージ id](#identity-params) * [パッケージ マニフェスト](#manifest-params) * [クリーンアップ](#cleanup-params) * [アーキテクチャ](#architecture-params) * [その他](#other-params) アプリ コンソール ウィンドウで ``Get-Help`` コマンドを実行して完全な一覧を表示することもできます。 |||| |-------------|-----------|-------------| |<a id="setup-params" /> <strong>セットアップ パラメーター</strong> || |-Setup [&lt;SwitchParameter&gt;] |必須 |セットアップ モードで DesktopAppConverter を実行します。 セットアップ モードでは、用意されている基本イメージの展開をサポートします。| |-BaseImage &lt;String&gt; | 必須 |展開されていない基本イメージの完全パス。 このパラメーターは、-Setup を指定する場合に必要です。| | -LogFile &lt;String&gt; |省略可能 |ログ ファイルを指定します。 省略した場合は、ログ ファイルの一時的な場所が作成されます。| |-NatSubnetPrefix &lt;String&gt; |省略可能 |Nat インスタンスで使うプレフィックス値。 通常この値は、ホスト コンピューターがコンバーターの NetNat と同じサブネット範囲に割り当てられている場合にのみ変更します。 現在のコンバーターの NetNat 構成は **Get NetNat** コマンドレットを使って照会できます。 | |-NoRestart [&lt;SwitchParameter&gt;] |必須 |セットアップの実行中に再起動を要求しません (コンテナー機能を有効にするには再起動が必要です)。 | |<a id="conversion-params" /> <strong>変換パラメーター</strong>||| |-AppInstallPath &lt;String&gt; |省略可能 |インストール済みのファイルに対応する、アプリケーションのルート フォルダーの完全パス (インストールされている場合)。"C:\Program Files (x86)\MyApp" など。| |-Destination &lt;String&gt; |必須 |コンバーターの appx を出力する場所。この場所がまだ存在しない場合は、DesktopAppConverter によって作成されます。| |-Installer &lt;String&gt; |必須 |アプリケーションのインストーラーのパス。無人/サイレント モードで実行できるようにする必要があります。 No インストーラー変換では、これは、アプリケーション ファイルのルート ディレクトリのパスです。 | |-InstallerArguments &lt;String&gt; |省略可能 |インストーラーに無人/サイレント モードでの実行を強制する引数の文字列、またはコンマ区切り一覧。 インストーラーが msi の場合は、このパラメーターは省略可能です。 インストーラーからログを取得するには、ここで、インストーラーのログ記録の引数を指定し、パス &lt;log_folder&gt; (コンバーターが適切なパスに置換するトークン) を使います。 <br><br>**注**:サイレント/無人のフラグとログ引数インストーラー テクノロジによって異なります。 <br><br>このパラメーターの使用例: - InstallerArguments"/silent/log &lt;log_folder&gt;\install.log"ログ ファイルを生成しない別の例のようになります。```-InstallerArguments "/quiet", "/norestart"``` ここでも、する指示する必要が文字どおりトークンのパスにログがあれば&lt;log_folder&gt;する場合はそれをキャプチャし、最後のログ フォルダーに配置するコンバーター。| |-InstallerValidExitCodes &lt;Int32&gt; |省略可能 |インストーラーを示す終了コードのコンマ区切りの一覧が正常に実行 (例。0、1234、5678)。 既定では、非 msi は 0、msi は 0, 1641, 3010 です。| |-MakeAppx [&lt;SwitchParameter&gt;] |省略可能 |このスクリプトに出力で MakeAppx を呼び出すように指示するスイッチ (存在する場合)。 | |-MakeMSIX [&lt;SwitchParameter&gt;] |省略可能 |存在する場合、MSIX パッケージとして出力をパッケージ化するには、このスクリプトに指示するスイッチ。 | |<a id="identity-params" /><strong>パッケージの id パラメーター</strong>|| |-PackageName &lt;String&gt; |必須 |ユニバーサル Windows アプリ パッケージの名前。 パートナー センターによって id が数字で始まる場合、パッケージに割り当てられる場合に渡すことも確認、 <i>- AppId</i>パラメーター、およびそのパラメーターの値としては、(後にピリオドを区切り文字) 文字列サフィックスのみを使用します。 | |-Publisher &lt;String&gt; |必須 |ユニバーサル Windows アプリ パッケージの発行元 | |-Version &lt;Version&gt; |必須 |ユニバーサル Windows アプリ パッケージのバージョン番号 | |<a id="manifest-params" /><strong>パッケージ マニフェストのパラメーター</strong>|| |-AppExecutable &lt;String&gt; |省略可能 |アプリケーションのメインの実行可能ファイルの名前 (例:"MyApp.exe")。 インストーラーを使用しない変換では、このパラメーターは必須です。 | |-AppFileTypes &lt;String&gt;|省略可能 |アプリケーションに関連付ける、ファイルの種類のコンマ区切りの一覧。 使用例: -AppFileTypes "'.md', '.markdown'"。| |-AppId &lt;String&gt; |省略可能 |Windows アプリ パッケージ マニフェストでアプリケーション ID を設定する値を指定します。 指定しなかった場合は、*PackageName* で渡した値が設定されます。 多くの場合、*PackageName* を使って問題ありません。 ただし、パートナー センターでは、id を数字で始まる場合、パッケージに割り当てられる場合、確認で渡すことも、 <i>- AppId</i>パラメーター、およびそのパラメーターの値としては、(後にピリオドを区切り文字) 文字列サフィックスのみを使用します。 | |-AppDisplayName &lt;String&gt; |省略可能 |Windows アプリ パッケージ マニフェストでアプリケーションの表示名を設定する値を指定します。 指定しなかった場合は、*PackageName* で渡した値が設定されます。 | |-AppDescription &lt;String&gt; |省略可能 |Windows アプリ パッケージ マニフェストでアプリケーションの説明を設定する値を指定します。 指定しなかった場合は、*PackageName* で渡した値が設定されます。| |-PackageDisplayName &lt;String&gt; |省略可能 |Windows アプリ パッケージ マニフェストでパッケージの表示名を設定する値を指定します。 指定しなかった場合は、*PackageName* で渡した値が設定されます。 | |-PackagePublisherDisplayName &lt;String&gt; |省略可能 |Windows アプリ パッケージ マニフェストでパッケージ発行元の表示名を設定する値を指定します。 指定しないと、*Publisher* で渡した値が設定されます。 | |<a id="cleanup-params" /><strong>クリーンアップ パラメーター</strong>||| |-Cleanup [&lt;Option&gt;] |必須 |DesktopAppConverter の成果物のクリーンアップを実行します。 クリーンアップ モードには 3 つの有効なオプションがあります。 | |-Cleanup All | |展開済みのすべての基本イメージを削除し、コンバーターのすべての一時ファイルを削除します。コンテナーのネットワークを削除し、Windows のオプション機能、コンテナーを無効にします。 | |-Cleanup WorkDirectory |必須 |コンバーターのすべての一時ファイルを削除します。 | |-Cleanup ExpandedImage |必須 |ホスト コンピューターにインストールされているすべての展開済みの基本イメージを削除します。 | |<a id="architecture-params" /><strong>パッケージ アーキテクチャ パラメーター</strong>||| |-PackageArch &lt;String&gt; |必須 |指定したアーキテクチャのパッケージを生成します。 有効なオプションは、'x86' または 'x64' です。たとえば、-PackageArch x86 のように指定します。 このパラメーターは省略可能です。 指定されていない場合、DesktopAppConverter はパッケージのアーキテクチャの自動検出を試みます。 自動検出に失敗した場合、既定値は x64 パッケージです。 | |<a id="other-params" /><strong>その他のパラメーター</strong>||| |-ExpandedBaseImage &lt;String&gt; |省略可能 |既に展開済みの基本イメージの完全パス。| |-LogFile &lt;String&gt; |省略可能 |ログ ファイルを指定します。 省略した場合は、ログ ファイルの一時的な場所が作成されます。 | | -Sign [&lt;SwitchParameter&gt;] |省略可能 |出力する Windows アプリ パッケージに、テスト用に生成された証明書を使用して署名するようにこのスクリプトに指示します。 このスイッチは、```-MakeAppx``` スイッチと共に含める必要があります。 | |&lt;共通パラメーター&gt; |必須 |このコマンドレットでは、*詳細な*、*デバッグ*、 *ErrorAction*、 *ErrorVariable*、 *WarningAction*、 *WarningVariable*、 *OutBuffer*、 *PipelineVariable*、および*OutVariable*します。 詳細については、「[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216)」をご覧ください。 | | -Verify [&lt;SwitchParameter&gt;] |省略可能 |存在する場合は、パッケージ アプリと Microsoft Store の要件に対してアプリ パッケージを検証する DAC を通知するスイッチ。 結果は、検証レポート "VerifyReport.xml" で、ブラウザーでの視覚化に最適です。 このスイッチは、`-MakeAppx` スイッチと共に含める必要があります。 | |-PublishComRegistrations| 省略可能| インストーラーによって行われたすべての パブリック COM 登録をスキャンし、有効な登録をマニフェストで公開します。 このフラグは、これらの登録を他のアプリケーションで利用できるようにする場合にのみ使用してください。 これらの登録を対象アプリケーションでのみ使用する場合、このフラグを使用する必要はありません。 <br><br>アプリをパッケージ化した後、正常に動作するように COM 登録を行うには、[こちらの記事](https://blogs.windows.com/buildingapps/2017/04/13/com-server-ole-document-support-desktop-bridge/#lDg5gSFxJ2TDlpC6.97)をご覧ください。 <a id="run-app" /> ## <a name="run-the-packaged-app"></a>パッケージ アプリを実行する アプリを実行するには、2 種類の方法があります。 1 つ目は、PowerShell コマンド プロンプトを開いて、```Add-AppxPackage –Register AppxManifest.xml``` というコマンドを入力する方法です。 署名する必要がないために、アプリケーションを実行する最も簡単な方法です。 別の方法では、証明書を使用してアプリケーションに署名します。 使用する場合、 ```sign``` Desktop App Converter のパラメーターは、1 つを生成し、それを使用してアプリケーションにサインインします。 その証明書ファイルは **auto-generated.cer** という名前になり、パッケージ アプリのルート フォルダーに配置されます。 生成された証明書をインストールし、アプリを実行するには、次の手順を実行します。 1. **auto-generated.cer** ファイルをダブルクリックして証明書をインストールします。 ![生成された証明書ファイル](images/desktop-to-uwp/generated-cert-file.png) > [!NOTE] > パスワードを求められた場合は、既定のパスワード "123456" を使用します。 2. **[証明書]** ダイアログ ボックスで、**[証明書のインストール]** を選択します。 3. **証明書インポート ウィザード**で、証明書を**ローカル コンピューター**にインストールし、証明書を "**信頼されたユーザー**" の証明書ストアに配置します。 ![信頼されたユーザー ストア](images/desktop-to-uwp/trusted-people-store.png) 5. パッケージ アプリのルート フォルダーで、Windows アプリのパッケージ ファイルをダブルクリックします。 ![Windows アプリのパッケージ ファイル](images/desktop-to-uwp/windows-app-package.png) 6. **[インストール]** を選択してアプリをインストールします。 ![[インストール] ボタン](images/desktop-to-uwp/install.png) ## <a name="modify-the-packaged-app"></a>パッケージ アプリを変更する バグに対処、ビジュアルの資産を追加またはライブ タイルなどの最新のエクスペリエンスを使用してアプリケーションを強化をパッケージ化されたアプリケーションに変更を行います可能性があります。 変更を加えた後、もう一度コンバーターを実行する必要はありません。 ほとんどの場合、MakeAppx ツールを使用してアプリケーションを再パッケージすることができますのみと、アプリの DAC appxmanifest.xml ファイルが生成されます。 「[Windows アプリ パッケージを生成する](desktop-to-uwp-manual-conversion.md#make-appx)」をご覧ください。 * アプリのビジュアル アセットを変更する場合、新しいパッケージ リソース インデックス ファイルを生成し、MakeAppx ツールを実行して新しいパッケージを生成します。 「[パッケージ リソース インデックス (PRI) ファイルを生成する](desktop-to-uwp-manual-conversion.md#make-pri)」をご覧ください。 * Windows タスク バー、タスク ビュー、スナップ アシスト、Alt + Tab キーを押したときの一覧、およびスタート画面のタイルの右下に表示されるアイコンおよびタイルを追加する場合は、「[(省略可能) ターゲット ベースのプレートなしのアセットを追加する](desktop-to-uwp-manual-conversion.md#target-based-assets)」をご覧ください。 > [!NOTE] > インストーラーによるレジストリ設定を変更した場合は、その変更を適用するために、Desktop App Converter をもう一度実行する必要があります。 **動画** |出力の変更と再パッケージ化 |デモ:出力の変更と再パッケージ化| |---|---| |<iframe src="https://mva.microsoft.com/en-US/training-courses-embed/developers-guide-to-the-desktop-bridge-17373/Video-Modifying-and-Repackaging-Output-from-Desktop-App-Converter-OwpAJ3WhD_6706218965" width="426" height="472" allowFullScreen frameBorder="0"></iframe>|<iframe src="https://mva.microsoft.com/en-US/training-courses-embed/developers-guide-to-the-desktop-bridge-17373/Demo-Modify-Output-from-Desktop-App-Converter-gEnsa3WhD_8606218965" width="426" height="472" allowFullScreen frameBorder="0"></iframe>| 次の 2 つのセクションでは、いくつかの可能性があるパッケージ化されたアプリケーションに省略可能なによる修正について説明します。 ### <a name="delete-unnecessary-files-and-registry-keys"></a>不要なファイルとレジストリ キーを削除する Desktop App Converter は、コンテナー内のファイルとシステム ノイズの除去に、非常に保守的なアプローチを取ります。 VFS フォルダーを確認し、インストーラーに必要ないファイルがあれば、削除することもできます。 また、Reg.dat の内容を確認し、アプリによってインストールされないキーや不要なキーがあれば、削除できます。 ### <a name="fix-corrupted-pe-headers"></a>破損した PEヘッダーを修正する DesktopAppConverter は 変換処理中に PEHeaderCertFixTool を自動的に実行し、破損している PEヘッダーを修正します。 ただし、UWP の Windows アプリ パッケージ、ルーズ ファイル、または特定のバイナリで、PEHeaderCertFixTool を実行することも可能です。 次に例を示します。 ```CMD PEHeaderCertFixTool.exe <binary file>|<.appx package>|<folder> [/c] [/v] /c -- check for corrupted certificate but do not fix (optional) /v -- verbose (optional) example1: PEHeaderCertFixTool app.exe example2: PEHeaderCertFixTool c:\package.appx /c example3: PEHeaderCertFixTool c:\myapp /c /v ``` ## <a name="telemetry-from-desktop-app-converter"></a>Desktop App Converter の利用統計情報 Desktop App Converter は、ソフトウェアの使用者と使用方法に関する情報を収集して、この情報を Microsoft に送信することがあります。 Microsoft のデータ収集と製品ドキュメントでの使用の詳細については、「[マイクロソフトのプライバシーに関する声明](https://go.microsoft.com/fwlink/?LinkId=521839)」をご覧ください。 お客様は、本ソフトウェアを使用することにより、マイクロソフトのプライバシーに関する声明のすべての適用規定を遵守することに同意したものと見なされます。 既定では、Desktop App Converter の利用統計情報は有効にされています。 利用統計情報を目的の設定に構成するには、次のレジストリ キーを追加します。 ```cmd HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DesktopAppConverter ``` + DWORD を 1 に設定して、*DisableTelemetry* 値を追加または編集します。 + 利用統計情報を有効にするには、このキーを削除するかキーの値を 0 に設定します。 ### <a name="language-support"></a>サポート言語 Desktop App Converterは、Unicode をサポートしていません。したがって、漢字または非 ASCII 文字をツールで使用することはできません。 ## <a name="next-steps"></a>次のステップ **質問の回答を検索** ご質問がある場合は、 Stack Overflow でお問い合わせください。 Microsoft のチームでは、これらの[タグ](https://stackoverflow.com/questions/tagged/project-centennial+or+desktop-bridge)をチェックしています。 [こちら](https://social.msdn.microsoft.com/Forums/en-US/home?filter=alltypes&sort=relevancedesc&searchTerm=%5BDesktop%20Converter%5D)から質問することもできます。 [ここ](desktop-to-uwp-known-issues.md#app-converter)で既知の問題の一覧を確認することもできます。 **ご意見や機能を提案します。** [UserVoice](https://wpdev.uservoice.com/forums/110705-universal-windows-platform/category/161895-desktop-bridge-centennial) のページをご覧ください。 **アプリケーションを実行/を検索し、問題を修正** 参照してください[実行、デバッグ、およびデスクトップ アプリケーションをパッケージ化されたテスト](desktop-to-uwp-debug.md) **アプリを配布します。** 参照してください[パッケージ化されたデスクトップ アプリケーションの配布](desktop-to-uwp-distribute.md) ======================= File: windows-apps-src/porting/package-support-framework.md ======================= <reponame>joannaleecy/windows-uwp-pr.ja-jp<gh_stars>1-10 --- Description: デスクトップ アプリケーションの MSIX コンテナーで実行を妨げる問題を修正します。 Search.Product: eADQiWindows 10XVcnh title: デスクトップ アプリケーションの MSIX コンテナーで実行を妨げる問題を修正します。 ms.date: 07/02/2018 ms.topic: article keywords: windows 10, uwp ms.localizationpriority: medium ms.openlocfilehash: 80f9c8bad9445bd9cfef9b09c00f99929fda37aa ms.sourcegitcommit: b034650b684a767274d5d88746faeea373c8e34f ms.translationtype: MT ms.contentlocale: ja-JP ms.lasthandoff: 03/06/2019 ms.locfileid: "57590727" --- # <a name="apply-runtime-fixes-to-an-msix-package-by-using-the-package-support-framework"></a>MSIX パッケージにパッケージのサポートのフレームワークを使用してランタイム修正プログラムを適用します。 パッケージのサポート、フレームワークは、修正プログラムを適用、既存の win32 アプリケーションに、ソース コードへのアクセス権がないときに、MSIX コンテナーで実行できるようにするのに役立つオープン ソース キット。 パッケージのサポート、フレームワークには、最新のランタイム環境のベスト プラクティスに従って、アプリケーションが役立ちます。 詳細についてを参照してください。[パッケージ サポート フレームワーク](https://docs.microsoft.com/windows/msix/package-support-framework-overview)します。 このガイドを利用するアプリケーションの互換性の問題を特定して、検索、適用、およびランタイムを拡張するには、それらに対処するを修正します。 <a id="identify" /> ## <a name="identify-packaged-application-compatibility-issues"></a>パッケージ化されたアプリケーションの互換性の問題を特定します。 最初に、アプリケーションのパッケージを作成します。 その後、インストール、実行、およびその動作を確認します。 互換性に関する問題の特定に役立つエラー メッセージを表示可能性があります。 使用することも[プロセス モニター](https://docs.microsoft.com/en-us/sysinternals/downloads/procmon)の問題を特定します。 一般的な問題は、作業ディレクトリとプログラムのパスのアクセス許可に関する前提条件をアプリケーションに関連します。 ### <a name="using-process-monitor-to-identify-an-issue"></a>Process Monitor を使用して、問題を識別するには [プロセス モニター](https://docs.microsoft.com/en-us/sysinternals/downloads/procmon)はアプリのファイルとレジストリの操作とその結果を監視するための強力なユーティリティです。 アプリケーション互換性の問題を理解することができます。 Process Monitor を開いた後、フィルターの追加 (フィルター > フィルター...) アプリケーションの実行可能ファイルからのイベントのみを含めます。 ![ProcMon アプリのフィルター](images/desktop-to-uwp/procmon_app_filter.png) イベントの一覧が表示されます。 これらのイベントでは、単語の多くの**成功**に表示されます、**結果**列。 ![ProcMon イベント](images/desktop-to-uwp/procmon_events.png) 必要に応じて、のみエラーのみを表示するイベントをフィルター処理することができます。 ![ProcMon 除外成功](images/desktop-to-uwp/procmon_exclude_success.png) ファイル システム アクセスの失敗を疑いがある場合は、System32/SysWOW64 またはパッケージのファイル パスのいずれかの下にある失敗したイベントを検索します。 フィルターも役立ちますここでは、すぎます。 この一覧の下部にある開始し、上方向にスクロールします。 この一覧の下部に表示されるエラーが発生した最も最近です。 "パス/名前 not found"、「アクセスが拒否されると、」などの文字列が含まれているエラーをほとんど注意し、不審な外観がないことを無視します。 [PSFSample](https://github.com/Microsoft/MSIX-PackageSupportFramework/blob/master/samples/PSFSample/)は 2 つの問題があります。 次の図に表示される一覧でこれらの問題が発生することができます。 ![ProcMon Config.txt](images/desktop-to-uwp/procmon_config_txt.png) このイメージに表示される最初の問題では"C:\Windows\SysWOW64"パスにある"Config.txt"ファイルを読み取るアプリケーションが失敗します。 可能性の高いアプリケーションがそのパスを直接参照しようとしていることはできません。 相対パスを使用してそのファイルから読み取るしようとして、"System32/SysWOW64"は、アプリケーションの作業ディレクトリを既定では、ほとんどの場合。 これは、アプリケーションがパッケージにどこかに設定する現在の作業ディレクトリを期待していたを示しています。 Appx、内部で見ると、実行可能ファイルと同じディレクトリにファイルが存在することを確認できます。 ![アプリ Config.txt](images/desktop-to-uwp/psfsampleapp_config_txt.png) 2 つ目の問題は、次の図に表示されます。 ![ProcMon ログ ファイル](images/desktop-to-uwp/procmon_logfile.png) 今月号では、そのパッケージのパスを.log ファイルを記述するアプリケーションが失敗します。 これにより、ファイル リダイレクト フィックス アップに役立つことが提案します。 <a id="find" /> ## <a name="find-a-runtime-fix"></a>ランタイム修正プログラムを検索します。 PSF には、ファイルのリダイレクトの修正など、現時点で使用できるランタイム修正プログラムが含まれています。 ### <a name="file-redirection-fixup"></a>ファイルのリダイレクトの修正 使用することができます、[ファイル リダイレクト Fixup](https://github.com/Microsoft/MSIX-PackageSupportFramework/tree/master/fixups/FileRedirectionFixup)しようとして書き込みまたは読み取り MSIX コンテナーで実行されるアプリケーションからアクセスできないディレクトリ内のデータをリダイレクトします。 などの場合は、アプリケーションの実行可能ファイルと同じディレクトリ内にあるログ ファイルに書き込むと、アプリケーション、しを使用できます、[ファイル リダイレクト Fixup](https://github.com/Microsoft/MSIX-PackageSupportFramework/tree/master/fixups/FileRedirectionFixup)ローカル アプリのデータ ストアなどの別の場所にそのログ ファイルを作成します。 ### <a name="runtime-fixes-from-the-community"></a>コミュニティからのランタイムの修正 コミュニティの貢献を検討してください、 [GitHub](https://github.com/Microsoft/MSIX-PackageSupportFramework)ページ。 他の開発者が自分とよく似た問題が解決し、ランタイム修正プログラムを共有していることができます。 ## <a name="apply-a-runtime-fix"></a>ランタイム修正プログラムを適用します。 Windows SDK から、次の手順では、いくつかの簡単なツールでの既存のランタイム修正プログラムを適用できます。 > [!div class="checklist"] > * パッケージ レイアウト フォルダーを作成します。 > * パッケージのサポート フレームワーク ファイルを取得します。 > * パッケージに追加します。 > * パッケージ マニフェストの変更 > * 構成ファイルを作成します。 各タスクを見ていきましょう。 ### <a name="create-the-package-layout-folder"></a>パッケージ レイアウト フォルダーを作成します。 .Msix (または.appx) ファイルが既にがある場合は、パッケージのステージング領域として機能するレイアウト フォルダーにその内容をアンパックすることができます。 SDK のインストール パスに基づく MakeAppx ツールを使用してコマンド プロンプトから実行することが、これは、Windows 10 PC で makeappx.exe ツールを表示します x86:。C:\Program Files (x86) \Windows Kits\10\bin\x86\makeappx.exe x64:C:\Program Files (x86) \Windows Kits\10\bin\x64\makeappx.exe ```ps makeappx unpack /p PSFSamplePackage_1.0.60.0_AnyCPU_Debug.msix /d PackageContents ``` これが表示されます、次のようになります。 ![パッケージのレイアウト](images/desktop-to-uwp/package_contents.png) を持っていない.msix (または.appx) ファイルから始める場合は、最初からパッケージ フォルダーとファイルを作成できます。 ### <a name="get-the-package-support-framework-files"></a>パッケージのサポート フレームワーク ファイルを取得します。 PSF Nuget パッケージは、スタンドアロンの Nuget コマンド ライン ツールを使用して、または Visual Studio を使用して取得できます。 #### <a name="get-the-package-by-using-the-command-line-tool"></a>コマンド ライン ツールを使用してパッケージを取得します。 この場所からの Nuget コマンド ライン ツールのインストール: https://www.nuget.org/downloads します。 次に、Nuget コマンドラインからこのコマンドを実行します。 ```ps nuget install Microsoft.PackageSupportFramework ``` #### <a name="get-the-package-by-using-visual-studio"></a>Visual Studio を使用してパッケージを取得します。 Visual Studio で、ソリューションまたはプロジェクト ノードを右クリックし、Nuget パッケージの管理コマンドのいずれかを選択します。 検索**Microsoft.PackageSupportFramework**または**PSF** Nuget.org でパッケージを検索します。次に、インストールします。 ### <a name="add-the-package-support-framework-files-to-your-package"></a>パッケージのサポート フレームワーク ファイルをパッケージに追加します。 パッケージ ディレクトリに必要な 32 ビットおよび 64 ビット PSF Dll と実行可能ファイルを追加します。 次の表をガイドとして使用してください。 含める必要があるランタイム修正する必要もあります。 この例では、ファイル リダイレクト ランタイム修正プログラムが必要です。 | アプリケーション実行可能ファイルは、x64 | アプリケーション実行可能ファイルは、x86 | |-------------------------------|-----------| | [PSFLauncher64.exe](https://github.com/Microsoft/MSIX-PackageSupportFramework/tree/master/PsfLauncher/readme.md) | [PSFLauncher32.exe](https://github.com/Microsoft/MSIX-PackageSupportFramework/tree/master/PsfLauncher/readme.md) | | [PSFRuntime64.dll](https://github.com/Microsoft/MSIX-PackageSupportFramework/tree/master/PsfRuntime/readme.md) | [PSFRuntime32.dll](https://github.com/Microsoft/MSIX-PackageSupportFramework/tree/master/PsfRuntime/readme.md) | | [PSFRunDll64.exe](https://github.com/Microsoft/MSIX-PackageSupportFramework/blob/master/PsfRunDll/readme.md) | [PSFRunDll32.exe](https://github.com/Microsoft/MSIX-PackageSupportFramework/blob/master/PsfRunDll/readme.md) | パッケージの内容は次のようになります。 ![パッケージのバイナリ](images/desktop-to-uwp/package_binaries.png) ### <a name="modify-the-package-manifest"></a>パッケージ マニフェストの変更 テキスト エディターで、パッケージ マニフェストを開き、設定し、`Executable`の属性、`Application`要素 PSF 起動ツールの実行可能ファイルの名前にします。 ターゲット アプリケーションのアーキテクチャがわかっている場合は、PSFLauncher32.exe または PSFLauncher64.exe は、適切なバージョンを選択します。 ない場合は、PSFLauncher32.exe は常に動作します。 次に例を示します。 ```xml <Package...> ... <Applications> <Application Id="PSFSample" Executable="PSFLauncher32.exe" EntryPoint="Windows.FullTrustApplication"> ... </Application> </Applications> </Package> ``` ### <a name="create-a-configuration-file"></a>構成ファイルを作成します。 ファイル名を作成``config.json``パッケージのルート フォルダーにそのファイルを保存します。 交換した実行可能ファイルをポイントする config.json ファイルの宣言されたアプリ ID を変更します。 Process Monitor を使用してから、獲得した知識を使用して、することができますも作業ディレクトリの設定だけでなくファイル リダイレクト フィックス アップを使用してパッケージ相対"PSFSampleApp"ディレクトリの下の.log ファイルに読み取り/書き込みをリダイレクトします。 ```json { "applications": [ { "id": "PSFSample", "executable": "PSFSampleApp/PSFSample.exe", "workingDirectory": "PSFSampleApp/" } ], "processes": [ { "executable": "PSFSample", "fixups": [ { "dll": "FileRedirectionFixup.dll", "config": { "redirectedPaths": { "packageRelative": [ { "base": "PSFSampleApp/", "patterns": [ ".*\\.log" ] } ] } } } ] } ] } ``` Config.json スキーマのためのガイドを次に示します。 | 配列 | key | Value | |-------|-----------|-------| | applications | id | 値を使用して、`Id`の属性、`Application`パッケージ マニフェスト内の要素。 | | applications | 実行可能ファイル | 開始する実行可能ファイルへのパッケージの相対パス。 ほとんどの場合、変更する前に、パッケージ マニフェスト ファイルからこの値を取得できます。 値は、`Executable`の属性、`Application`要素。 | | applications | WorkingDirectory | (省略可能)起動するアプリケーションの作業ディレクトリとして使用するパッケージの相対パス。 オペレーティング システムを使用して、この値を設定しない場合、`System32`ディレクトリをアプリケーションの作業ディレクトリ。 | | プロセス | 実行可能ファイル | ほとんどの場合、対象になりますの名前、`executable`削除パスとファイル拡張子で上に構成されています。 | | フィックス アップ | dll | 修正、.msix/.appx を読み込むパッケージの相対パス。 | | フィックス アップ | 構成 | (省略可能)フィックス アップ dl の動作を制御します。 この値の正確な形式は、各フィックス アップが必要があると"blob"を解釈できるよう、フィックス アップの修正によってごとに異なります。 | `applications`、 `processes`、および`fixups`キーは配列です。 つまり、1 つ以上のアプリケーション、プロセス、および DLL のフィックス アップを指定する config.json ファイルを使用することができます。 ### <a name="package-and-test-the-app"></a>パッケージとアプリをテストします 次に、パッケージを作成します。 ```ps makeappx pack /d PackageContents /p PSFSamplePackageFixup.msix ``` 次に、署名します。 ```ps signtool sign /a /v /fd sha256 /f ExportedSigningCertificate.pfx PSFSamplePackageFixup.msix ``` 詳細については、次を参照してください[署名証明書パッケージを作成する方法](https://docs.microsoft.com/en-us/windows/desktop/appxpkg/how-to-create-a-package-signing-certificate)と[signtool を使用してパッケージに署名する方法。](https://docs.microsoft.com/en-us/windows/desktop/appxpkg/how-to-sign-a-package-using-signtool) PowerShell を使用してパッケージをインストールします。 >[!NOTE] > まず、パッケージをアンインストールしてください。 ```ps powershell Add-AppPackage.\PSFSamplePackageFixup.msix ``` アプリケーションを実行し、ランタイムの修正プログラムが適用されると、動作を確認します。 診断および必要に応じて、パッケージ化の手順を繰り返します。 ### <a name="use-the-trace-fixup"></a>トレースのフィックス アップを使用して、 パッケージ化されたアプリケーション互換性の問題を診断するために別の手法では、トレースのフィックス アップを使用します。 この DLL は、PSF に含まれているし、プロセス モニターと類似した、アプリの動作の詳細な診断ビューを提供します。 アプリケーション互換性の問題を表示するように設計します。 トレース フィックス アップ、DLL、パッケージを追加するの config.json に次のフラグメントを追加しパッケージ化をし使用するアプリケーションをインストールします。 ```json { "dll": "TraceFixup.dll", "config": { "traceLevels": { "filesystem": "allFailures" } } } ``` 既定では、トレースのフィックス アップ「が必要です」と見なされてエラーが除外されます。 たとえば、アプリケーションは、無条件でファイルを削除するかどうかは、既に存在する、結果を無視して確認せずにしようと可能性があります。 これは、上記の例では、ことを選択します filesystem 関数からすべてのエラーを受信するためのいくつかの予期しないエラーが取得除外された、残念な結果です。 そうため、その前に、Config.txt ファイルから読み取りを試みるは、メッセージ「ファイルが見つかりません」で失敗からわかるようにします。 これは、障害が頻繁に観察しは、一般に、予期できないと見なされます。 実際には予期しない故障にのみフィルター処理し、フォールバックしてエラーをすべてまだ識別できない問題がある場合を開始する可能性の高い最適になります。 既定では、トレースの修正から出力を取得、アタッチされたデバッガーに送信されます。 この例では、デバッガーをアタッチしようとしています。 おは代わりに使用、 [DebugView](https://docs.microsoft.com/en-us/sysinternals/downloads/debugview) sysinternals 出力を表示するプログラム。 アプリを実行した後には、ことがわかります同じ障害と同様に、同じランタイム修正プログラムにごポイントします。 ![TraceShim ファイルが見つかりません](images/desktop-to-uwp/traceshim_filenotfound.png) ![TraceShim アクセスが拒否されました](images/desktop-to-uwp/traceshim_accessdenied.png) ## <a name="debug-extend-or-create-a-runtime-fix"></a>デバッグ、拡張、またはランタイム修正プログラムの作成 Visual Studio を使用して、ランタイム修正プログラムをデバッグ、実行時の修正プログラムを拡張または最初から作成することができます。 成功するこれらの作業を行う必要があります。 > [!div class="checklist"] > * パッケージのプロジェクトを追加します。 > * プロジェクト ランタイム修正プログラムを追加します。 > * 実行可能ファイルの PSF ランチャーを起動するプロジェクトを追加します。 > * パッケージ プロジェクトを構成します。 完了すると、ソリューションは次のようになります。 ![完成したソリューション](images/desktop-to-uwp/runtime-fix-project-structure.png) この例では、各プロジェクトを見てみましょう。 | Project | 目的 | |-------|-----------| | DesktopApplicationPackage | このプロジェクトがに基づいて、 [Windows アプリケーション パッケージ プロジェクト](desktop-to-uwp-packaging-dot-net.md)MSIX パッケージを出力します。 | | Runtimefix | これは、ランタイム修正プログラムとして機能する 1 つまたは複数の置換関数を含む C++ Dynamic-Linked ライブラリ プロジェクトです。 | | PSFLauncher | これは、C++ の空のプロジェクトです。 このプロジェクトは、パッケージのサポート、フレームワークのランタイム再頒布可能ファイルを収集する場所です。 実行可能ファイルを出力します。 この実行可能ファイルとは、ソリューションを開始するときに実行される最初のことです。 | | WinFormsDesktopApplication | このプロジェクトには、デスクトップ アプリケーションのソース コードが含まれています。 | これらの種類のプロジェクトのすべてを含む完全なサンプルを見るを参照してください。 [PSFSample](https://github.com/Microsoft/MSIX-PackageSupportFramework/blob/master/samples/PSFSample/)します。 作成し、ソリューションでこれらの各プロジェクトを構成する手順を見てみましょう。 ### <a name="create-a-package-solution"></a>パッケージ ソリューションを作成します。 デスクトップ アプリケーションのソリューションがいない場合は、新しい作成**空のソリューション**Visual Studio でします。 ![空のソリューション](images/desktop-to-uwp/blank-solution.png) 持つ任意のアプリケーション プロジェクトを追加することもできます。 ### <a name="add-a-packaging-project"></a>パッケージのプロジェクトを追加します。 まだ持っていない場合、 **Windows アプリケーション パッケージ プロジェクト**、1 つを作成し、ソリューションに追加します。 ![パッケージ プロジェクト テンプレート](images/desktop-to-uwp/package-project-template.png) Windows アプリケーション パッケージ プロジェクトの詳細については、次を参照してください。 [Visual Studio を使用して、アプリケーションをパッケージ化](desktop-to-uwp-packaging-dot-net.md)します。 **ソリューション エクスプ ローラー**をパッケージ プロジェクトを右クリックして選択**編集**、し、これをプロジェクト ファイルの末尾に追加します。 ```xml <Target Name="PSFRemoveSourceProject" AfterTargets="ExpandProjectReferences" BeforeTargets="_ConvertItems"> <ItemGroup> <FilteredNonWapProjProjectOutput Include="@(_FilteredNonWapProjProjectOutput)"> <SourceProject Condition="'%(_FilteredNonWapProjProjectOutput.SourceProject)'=='<your runtime fix project name goes here>'" /> </FilteredNonWapProjProjectOutput> <_FilteredNonWapProjProjectOutput Remove="@(_FilteredNonWapProjProjectOutput)" /> <_FilteredNonWapProjProjectOutput Include="@(FilteredNonWapProjProjectOutput)" /> </ItemGroup> </Target> ``` ### <a name="add-project-for-the-runtime-fix"></a>プロジェクト ランタイム修正プログラムを追加します。 C++ の追加**ダイナミック リンク ライブラリ (DLL)** プロジェクトがソリューションにします。 ![修正プログラムのランタイム ライブラリ](images/desktop-to-uwp/runtime-fix-library.png) クリックして、プロジェクトを右クリックして**プロパティ**します。 プロパティ ページで、 **C 言語標準**フィールド、およびそのフィールドの横にあるドロップダウン リストを選択します、 **ISO c++ 17 標準 (//std:c + + 17)** オプション。 ![17 の ISO オプション](images/desktop-to-uwp/iso-option.png) そのプロジェクトを右クリックし、コンテキスト メニューを選択、 **Nuget パッケージの管理**オプション。 いることを確認、**パッケージ ソース**にオプションが設定されている**すべて**または**nuget.org**します。 次にそのフィールドの設定 アイコンをクリックします。 検索、 *PSF** Nuget をパッケージ化し、このプロジェクトにインストールします。 ![nuget パッケージ](images/desktop-to-uwp/psf-package.png) デバッグまたは既存のランタイム修正プログラムを拡張する場合は、追加で説明されているガイダンスを使用して取得したランタイム修正プログラム ファイル、[ランタイム修正プログラムを見つける](#find)このガイドの「します。 新しい修正プログラムを作成する場合は、何も追加しないこのプロジェクトにまだだけです。 このガイドの後半では、このプロジェクトに適切なファイルを追加する手伝いします。 ここでは、ソリューションの設定がいく予定です。 ### <a name="add-a-project-that-starts-the-psf-launcher-executable"></a>実行可能ファイルの PSF ランチャーを起動するプロジェクトを追加します。 C++ の追加**空のプロジェクト**プロジェクトがソリューションにします。 ![空のプロジェクト](images/desktop-to-uwp/blank-app.png) 追加、 **PSF**前のセクションで説明されている同じガイダンスを使用してこのプロジェクトに Nuget パッケージ。 で、プロジェクトのプロパティ ページを開く、**全般**設定ページで、設定、**ターゲット名**プロパティを``PSFLauncher32``または``PSFLauncher64``アプリケーションのアーキテクチャに応じて。 ![PSF ランチャー参照](images/desktop-to-uwp/shim-exe-reference.png) ランタイム修正プログラムのプロジェクトへの参照をプロジェクトをソリューションに追加します。 ![ランタイム修正プログラムのリファレンス](images/desktop-to-uwp/reference-fix.png) 参照を右クリックし、**プロパティ**ウィンドウで、これらの値を適用します。 | プロパティ | Value | |-------|-----------| | ローカルのコピーします。 | True | | ローカル サテライト アセンブリをコピーします。 | True | | 参照アセンブリの出力 | True | | ライブラリ依存関係のリンク | False | | リンク ライブラリの依存関係の入力 | False | ### <a name="configure-the-packaging-project"></a>パッケージ プロジェクトを構成します。 パッケージ プロジェクトで、**[アプリケーション]** フォルダーを右クリックして **[参照の追加]** を選びます。 ![プロジェクト参照の追加](images/desktop-to-uwp/add-reference-packaging-project.png) PSF ランチャー プロジェクトと、デスクトップ アプリケーション プロジェクトを選択し、選択、 **OK**ボタンをクリックします。 ![デスクトップ プロジェクト](images/desktop-to-uwp/package-project-references.png) >[!NOTE] > アプリケーション ソース コードを持っていない場合は、PSF ランチャー プロジェクトを選択します。 構成ファイルを作成するときに、実行可能ファイルを参照する方法について説明します。 **アプリケーション**ノード、PSF ランチャー アプリケーションを右クリックし、**エントリ ポイントとして設定**します。 ![エントリ ポイントの設定](images/desktop-to-uwp/set-startup-project.png) という名前のファイルを追加``config.json``をパッケージ化プロジェクトにコピーし、次の json テキストをファイルに貼り付けます。 設定、**パッケージ アクション**プロパティを**コンテンツ**します。 ```json { "applications": [ { "id": "", "executable": "", "workingDirectory": "" } ], "processes": [ { "executable": "", "fixups": [ { "dll": "", "config": { } } ] } ] } ``` 各キーの値を指定します。 このテーブルをガイドとして使用します。 | 配列 | key | Value | |-------|-----------|-------| | applications | id | 値を使用して、`Id`の属性、`Application`パッケージ マニフェスト内の要素。 | | applications | 実行可能ファイル | 開始する実行可能ファイルへのパッケージの相対パス。 ほとんどの場合、変更する前に、パッケージ マニフェスト ファイルからこの値を取得できます。 値は、`Executable`の属性、`Application`要素。 | | applications | WorkingDirectory | (省略可能)起動するアプリケーションの作業ディレクトリとして使用するパッケージの相対パス。 オペレーティング システムを使用して、この値を設定しない場合、`System32`ディレクトリをアプリケーションの作業ディレクトリ。 | | プロセス | 実行可能ファイル | ほとんどの場合、対象になりますの名前、`executable`削除パスとファイル拡張子で上に構成されています。 | | フィックス アップ | dll | フィックス アップを読み込む DLL にパッケージの相対パス。 | | フィックス アップ | 構成 | (省略可能)フィックス アップ DLL の動作を制御します。 この値の正確な形式は、各フィックス アップが必要があると"blob"を解釈できるよう、フィックス アップの修正によってごとに異なります。 | 完了すると、``config.json``ファイルは次のようになります。 ```json { "applications": [ { "id": "DesktopApplication", "executable": "DesktopApplication/WinFormsDesktopApplication.exe", "workingDirectory": "WinFormsDesktopApplication" } ], "processes": [ { "executable": ".*App.*", "fixups": [ { "dll": "RuntimeFix.dll" } ] } ] } ``` >[!NOTE] > `applications`、 `processes`、および`fixups`キーは配列です。 つまり、1 つ以上のアプリケーション、プロセス、および DLL のフィックス アップを指定する config.json ファイルを使用することができます。 ### <a name="debug-a-runtime-fix"></a>ランタイム修正プログラムをデバッグします。 Visual Studio で f5 キーを押してデバッガーを起動します。 最初に起動するとは、さらに、ターゲット デスクトップ アプリケーションを起動する PSF のランチャー アプリケーションです。 対象のデスクトップ アプリケーションをデバッグするには、手動で選択してデスクトップ アプリケーションのプロセスにアタッチする必要があります**デバッグ**->**プロセスにアタッチ**、アプリケーションを選択プロセスです。 ネイティブ ランタイム修正プログラムを DLL と.NET アプリケーションのデバッグを許可するには、(混在モードのデバッグ) のマネージ コードとネイティブ コードの種類を選択します。 これを設定したらとは、デスクトップ アプリケーションのコードでランタイム修正プログラムのプロジェクトのコード行の横にあるブレークポイントを設定できます。 アプリケーション ソース コードを持っていない場合、ランタイム修正プログラムのプロジェクトでのコード行の横にあるブレークポイントを設定することができます。 >[!NOTE] > Visual Studio では、最も簡単な開発エクスペリエンスをデバッグするには、いくつかの制限があると、このガイドの後で取り上げます他のデバッグ手法を適用することができます。 ## <a name="create-a-runtime-fix"></a>ランタイム修正プログラムを作成します。 ない場合、ランタイムを解決することは、置換関数を作成し、構成データを含む新しいランタイム修正プログラムを作成することができます、問題の修正は合理的です。 各部分を見てみましょう。 ### <a name="replacement-functions"></a>置換関数 まず、MSIX コンテナーで、アプリケーションの実行時に呼び出しが失敗する関数を特定します。 次に、代わりに、ランタイム マネージャーを置換関数を作成できます。 これにより、最新のランタイム環境の規則に準拠した動作で、関数の実装を置き換えることです。 Visual Studio で、このガイドの前半で作成したランタイム修正プロジェクトを開きます。 宣言、``FIXUP_DEFINE_EXPORTS``マクロの include ステートメントを追加し、`fixup_framework.h`それぞれの上部にあります。CPP ファイルは、ランタイム修正プログラムの機能を追加します。 ```c++ #define FIXUP_DEFINE_EXPORTS #include <fixup_framework.h> ``` >[!IMPORTANT] >必ず、 `FIXUP_DEFINE_EXPORTS` include ステートメントの前にマクロが表示されます。 同じ関数のシグネチャを持つ関数を作成したが動作を変更します。 置換する関数の例を次に示します、`MessageBoxW`関数。 ```c++ auto MessageBoxWImpl = &::MessageBoxW; int WINAPI MessageBoxWFixup( _In_opt_ HWND hwnd, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR caption, _In_ UINT type) { return MessageBoxWImpl(hwnd, L"SUCCESS: This worked", caption, type); } DECLARE_FIXUP(MessageBoxWImpl, MessageBoxWFixup); ``` 呼び出し`DECLARE_FIXUP`マップ、`MessageBoxW`関数を新しい置換する関数。 アプリケーションが呼び出すしようとしたときに、`MessageBoxW`関数を置換する関数を代わりに呼び出すことがされます。 #### <a name="protect-against-recursive-calls-to-functions-in-runtime-fixes"></a>修正をランタイムに関数への再帰呼び出しから保護します。 必要に応じて適用することができます、`reentrancy_guard`修正をランタイムに関数への再帰呼び出しから保護する、関数への型。 たとえば、置換するための関数を生じる可能性があります、`CreateFile`関数。 実装を呼び出すことができます、`CopyFile`関数がの実装、`CopyFile`関数を呼び出すことができます、`CreateFile`関数。 呼び出しの無限の再帰的なサイクルが生じる、`CreateFile`関数。 詳細については`reentrancy_guard`を参照してください[authoring.md](https://github.com/Microsoft/MSIX-PackageSupportFramework/blob/master/Authoring.md) ### <a name="configuration-data"></a>構成データ 構成データ、ランタイム修正プログラムを追加する場合に追加することを検討してください、``config.json``します。 これでが使用できる、`FixupQueryCurrentDllConfig`を簡単にそのデータを解析します。 この例では、その構成ファイルからのブール値、および文字列の値を解析します。 ```c++ if (auto configRoot = ::FixupQueryCurrentDllConfig()) { auto& config = configRoot->as_object(); if (auto enabledValue = config.try_get("enabled")) { g_enabled = enabledValue->as_boolean().get(); } if (auto logPathValue = config.try_get("logPath")) { g_logPath = logPathValue->as_string().wstring(); } } ``` ## <a name="other-debugging-techniques"></a>その他のデバッグ技術 Visual Studio は、最も簡単な開発およびデバッグ エクスペリエンスをでは、中にいくつかの制限があります。 .Msix からインストールするのではなく、パッケージ レイアウト フォルダーのパスから圧縮しないファイルを展開して、アプリケーションを最初に、F5 デバッグ実行/.appx パッケージ。 レイアウト フォルダー通常が同じセキュリティ制限として、インストールされているパッケージのフォルダー。 その結果、ランタイム修正プログラムを適用する前にパッケージのパスへのアクセス拒否エラーを再現できないこと可能性があります。 この問題に対処.msix を使用して、f5 キーではなく、.appx パッケージの配置は、ファイルの配置を疎/。 .Msix を作成する/.appx パッケージ ファイルを使用して、 [MakeAppx](https://docs.microsoft.com/en-us/windows/desktop/appxpkg/make-appx-package--makeappx-exe-)前述のように、Windows SDK のユーティリティ。 またはから、Visual Studio 内で、アプリケーションのプロジェクト ノードを右クリックし、選択**ストア**->**アプリ パッケージの作成**です。 Visual Studio の別の問題は、デバッガーによって起動されたすべての子プロセスにアタッチするための組み込みサポートがないことです。 デバッグ対象のアプリケーションでは、関連付ける必要があります手動で Visual Studio によって起動した後の起動パス内のロジックを困難になります。 この問題に対処するには、子プロセスのアタッチをサポートする、デバッガーを使用します。 一般に、ターゲット アプリケーションへのジャストイン タイム (JIT) デバッガーをアタッチすることに注意してください。 これは、ほとんどの JIT 手法では、ImageFileExecutionOptions のレジストリ キーを使用して、対象とするアプリケーションの代わりにデバッガーを起動するが含まれるためにです。 これには、PSFLauncher.exe FixupRuntime.dll を対象となるアプリに挿入するための detouring メカニズムが果たせなくなります。 含まれる、WinDbg、[ツールを Windows のデバッグ](https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/index)から取得し、 [Windows SDK](https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk)、サポートする子プロセスのアタッチします。 また、直接サポート[を起動して、UWP アプリのデバッグ](https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/debugging-a-uwp-app-using-windbg#span-idlaunchinganddebuggingauwpappspanspan-idlaunchinganddebuggingauwpappspanspan-idlaunchinganddebuggingauwpappspanlaunching-and-debugging-a-uwp-app)します。 子プロセスとしてターゲット アプリケーションの起動をデバッグするには、開始``WinDbg``します。 ```ps windbg.exe -plmPackage PSFSampleWithFixup_1.0.59.0_x86__7s220nvg1hg3m -plmApp PSFSample ``` ``WinDbg``と表示されたら、子のデバッグを有効にする、適切なブレークポイントを設定します。 ```ps .childdbg 1 g ``` (対象のアプリケーションが開始され、デバッガーを中断するまで実行) ```ps sxe ld fixup.dll g ``` (フィックス アップ DLL が読み込まれるまで実行) ```ps bp... ``` >[!NOTE] > [PLMDebug](https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/plmdebug)を起動すると、アプリにデバッガーをアタッチすることも使用できにも含まれますが、[ツールを Windows のデバッグ](https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/index)します。 ただし、WinDbg によって提供されるようになりました direct サポートよりも複雑です。 ## <a name="support-and-feedback"></a>サポートとフィードバック **質問の回答を検索** ご質問がある場合は、 Stack Overflow でお問い合わせください。 Microsoft のチームでは、これらの[タグ](https://stackoverflow.com/questions/tagged/project-centennial+or+desktop-bridge)をチェックしています。 [こちら](https://social.msdn.microsoft.com/Forums/en-US/home?filter=alltypes&sort=relevancedesc&searchTerm=%5BDesktop%20Converter%5D)から質問することもできます。 ======================= File: windows-apps-src/graphics-concepts/rasterization-rules.md ======================= <reponame>joannaleecy/windows-uwp-pr.ja-jp<filename>windows-apps-src/graphics-concepts/rasterization-rules.md --- title: ラスター化ルール description: ラスター化ルールは、ベクトル データをラスター データにマップする方法を定義します。 ms.assetid: B604725F-96A5-4DB6-B597-9EC57FBBC024 keywords: - ラスター化ルール ms.date: 02/08/2017 ms.topic: article ms.localizationpriority: medium ms.openlocfilehash: c622c037f878d1ad34cdadf897dde10683532832 ms.sourcegitcommit: b034650b684a767274d5d88746faeea373c8e34f ms.translationtype: MT ms.contentlocale: ja-JP ms.lasthandoff: 03/06/2019 ms.locfileid: "57660867" --- # <a name="rasterization-rules"></a>ラスター化ルール ラスター化ルールは、ベクトル データをラスター データにマップする方法を定義します。 ラスター データは、整数値の位置に配置されてからカリングおよびクリッピングされ (描画するピクセルの数を最小限にするため)、ピクセル単位の属性が (頂点単位の属性から) 補間された後、ピクセル シェーダーに渡されます。 マップするプリミティブ タイプや、エイリアスを減らすためにデータでマルチサンプリングが使用されているかどうかに応じて、さまざまな種類のルールがあります。 次の図は、コーナーの処理方法を示したものです。 ## <a name="span-idtrianglespanspan-idtrianglespanspan-idtrianglespantriangle-rasterization-rules-without-multisampling"></a><span id="Triangle"></span><span id="triangle"></span><span id="TRIANGLE"></span>マルチ サンプリング) (なしの三角形のラスタライズ ルール 三角形の内部にあるピクセルの中心はすべて描画されます。左上ルールに適合すると、ピクセルは内部にあると見なされます。 左上ルールでは、ピクセルの中心が三角形の上のエッジまたは左のエッジにある場合に、三角形の内部にあると定義されます。 この場合 - 上のエッジは、完全に水平で、他のエッジよりも上にあるものです。 - 左のエッジは、完全には水平でなく、三角形の左側にあるものです。三角形には、左のエッジが 1 つまたは 2 つあります。 左上ルールによって、隣接する三角形が一度に描画されます。 三角形の内側にある、または左上ルールに適合しているために描画されるピクセルの例を次の図に示します。 ![左上ルールに適合する三角形のラスター化の例](images/d3d10-rasterrulestriangle.png) 薄い灰色と濃い灰色はピクセルのグループです。ピクセルがどの三角形の内部にあるのかを示しています。 ## <a name="span-idline1spanspan-idline1spanspan-idline1spanline-rasterization-rules-ali
65,942
thestackv1_concat_by_repo-long/65536-65536
:15.50% B:0.87%) 45.94% (G:11.14% B:0.44%) 3. Bar/20* 6/5 eq: +0.114 (-0.103) 52.62% (G:14.37% B:0.80%) 47.38% (G:12.35% B:0.62%) 4. Bar/20* 8/7 eq: +0.082 (-0.134) 51.58% (G:14.87% B:0.80%) 48.42% (G:12.24% B:0.56%) 5. Bar/24 13/8 eq: -0.227 (-0.443) 45.02% (G:12.50% B:0.56%) 54.98% (G:16.92% B:0.95%) 6. Bar/24 10/5 eq: -0.242 (-0.458) 44.71% (G:12.16% B:0.50%) 55.29% (G:16.93% B:0.95%) 7. Bar/24 8/3 eq: -0.369 (-0.585) 41.98% (G:11.61% B:0.53%) 58.02% (G:19.22% B:1.36%) </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "ZS2"; const probnum = "31"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle4", "cw"); board.showBoard("XGID=-b----E-C-A-dD---c-ea---AA:0:0:1:51:0:0:0:5:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/quizpager.js"></script> </body> </html> ======================= File: H/HA2/10.html ======================= <reponame>hinacoppy/problemPager <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>Hayashi Problem</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">問題番号 湘南123</span>&ensp; <span>(HA2-10)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">白51</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips White=132 Brown=132</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">正解ムーブは 9/4 9/8<br> (簡単な考え方・格言・セオリー: 無用なブロットは作るな)<br> 解説<br> 白は相手と全くの同型とは珍しい形です。<br> ピップカウント(ゴールまでの駒の距離の合計)は当然同じです。<br> このような場合には、ランニングで負けていないので、ブロットを無用に作らずに 9/4 9/8 とムーブするのが良い。<br> ランニングで負けていなければ「無用なブロットは作るな」と覚えてください。<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis"> 1. Cubeful 2-ply 9/8 9/4 Eq.: -0.002 0.498 0.070 0.001 - 0.502 0.067 0.001 2. Cubeful 2-ply 6/1 3/2 Eq.: -0.078 (-0.076) 0.476 0.063 0.001 - 0.524 0.071 0.001 3. Cubeful 2-ply 6/1 4/3 Eq.: -0.101 (-0.099) 0.468 0.068 0.001 - 0.532 0.076 0.002 4. Cubeful 2-ply 8/7 8/3 Eq.: -0.127 (-0.125) 0.458 0.075 0.001 - 0.542 0.077 0.002 5. Cubeful 2-ply 8/2 Eq.: -0.141 (-0.139) 0.453 0.075 0.001 - 0.547 0.076 0.002 </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "HA2"; const probnum = "10"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle3", "cw"); board.showBoard("XGID=---BBbC-BB--bB--bb-cBbb---:fc00:db20:35b:7399::5:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: C/CC4/25.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>ChrisBray</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">2020 - Position 175</span>&ensp; <span>(CC4-25)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Money Play. How should Red play 33?</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Red=104 White=138</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">The key to this problem is to make sure that White can play a 5 so that he is forced to dismantle his anchor on Red’s 2-pt.<br> The best way to do this 7/1(2), making an additional inner board point. 15/12, 7/4, 7/1 is the second-best play but that is still an error. Everything else is a blunder or worse.<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis"> 1. Cubeful 2-ply 7/1(2) Eq.: +1.155 0.900 0.384 0.012 - 0.100 0.006 0.000 2. Cubeful 2-ply 15/12 7/1 7/4 Eq.: +1.124 (-0.032) 0.896 0.363 0.012 - 0.104 0.007 0.000 3. Cubeful 2-ply 15/6 4/1 Eq.: +1.086 (-0.070) 0.891 0.340 0.010 - 0.109 0.009 0.000 4. Cubeful 2-ply 15/9 7/4(2) Eq.: +1.072 (-0.083) 0.890 0.324 0.013 - 0.110 0.007 0.000 5. Cubeful 2-ply 15/6 7/4 Eq.: +1.067 (-0.088) 0.883 0.336 0.014 - 0.117 0.009 0.000 </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "CC4"; const probnum = "25"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle2", "ccw"); board.showBoard("XGID=--bcBCCBBB-----A-----bcda-:1:-1:1:33:0:0:3:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: Z/ZP4/21.html ======================= <reponame>hinacoppy/problemPager <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>BG Quiz</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">Problem of Week: Position 201</span>&ensp; <span>(ZP4-21)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">White to play 53</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips White=89 Black=67</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description"><pre> 1. 20/17 20/15 eq: -0.620 16.43% (G: 0.00% B:0.00%) 83.57% (G: 0.00% B:0.00%) 2. 20/12 eq: -0.640 (-0.021) 16.05% (G: 0.08% B:0.00%) 83.95% (G: 1.14% B:0.01%) 3. 6/1 5/2 eq: -0.643 (-0.023) 15.66% (G: 0.02% B:0.00%) 84.34% (G: 0.72% B:0.00%) 4. 6/1 4/1 eq: -0.664 (-0.045) 14.71% (G: 0.05% B:0.00%) 85.29% (G: 0.76% B:0.00%) 5. 20/15 4/1 eq: -0.675 (-0.056) 14.57% (G: 0.16% B:0.00%) 85.43% (G: 1.67% B:0.01%) 6. 20/15 5/2 eq: -0.680 (-0.060) 14.49% (G: 0.15% B:0.00%) 85.51% (G: 1.82% B:0.02%) 7. 20/15 6/3 eq: -0.695 (-0.075) 13.81% (G: 0.10% B:0.00%) 86.19% (G: 1.67% B:0.01%) </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "ZP4"; const probnum = "21"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle4", "cw"); board.showBoard("XGID=-ABBCDA-----------cdBd-bb-:1:1:1:53:0:0:3:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/quizpager.js"></script> </body> </html> ======================= File: Z/ZP3/19.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>BG Quiz</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">Problem of Week: Position 206</span>&ensp; <span>(ZP3-19)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">White to play 63</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips White=135 Black=112</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description"><pre> 1. 10/4 6/3 eq: +0.456 63.90% (G:17.81% B:0.93%) 36.10% (G:12.58% B:1.14%) 2. 10/4 8/5 eq: +0.427 (-0.029) 61.65% (G:17.96% B:0.97%) 38.35% (G:11.35% B:0.78%) 3. 8/2 7/4 eq: +0.365 (-0.091) 60.08% (G:17.59% B:0.98%) 39.92% (G:13.57% B:1.25%) 4. 10/4 7/4 eq: +0.348 (-0.107) 59.47% (G:17.71% B:1.14%) 40.53% (G:12.05% B:0.81%) 5. 10/7 8/2 eq: -0.428 (-0.884) 41.41% (G: 8.12% B:0.30%) 58.59% (G:24.47% B:2.59%) 6. 8/2 6/3 eq: -0.575 (-1.031) 42.61% (G: 8.58% B:0.38%) 57.39% (G:32.78% B:5.18%) 7. 10/4 5/2 eq: -0.691 (-1.147) 37.28% (G: 7.40% B:0.27%) 62.72% (G:27.14% B:2.80%) </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "ZP3"; const probnum = "19"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle4", "cw"); board.showBoard("XGID=-b--ABCCC-A-------bccbc-B-:fc00:e968:6179::de52:7100:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/quizpager.js"></script> </body> </html> ======================= File: C/CBh/40.html ======================= <reponame>hinacoppy/problemPager<gh_stars>0 <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>ChrisBray</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">2016 - Position 238</span>&ensp; <span>(CBh-40)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Money Play. Should Red redouble? If redoubled, should White take?</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Red=19 White=30</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">This is a question of what formulae you use for bear-offs and how much time and effort you put into learning them.<br> <br> This is a rolls vs pips position on which the late Walter trice did a lot of work.<br> <br> Red has a virtual no miss five roll position so his effective pip count will be close to 7n+1 where n is the number of rolls. This gives him an EPC of 36 plus a bit for the fact that he may roll three ones. Let’s say his EPC his 36.5<br> <br> White’s EPC is his pip cunt (30) plus his wastage. The flat position (two checkers on each point) wastes 10 pips. White is better than that here so over the board I would estimate a wastage of 8 pips.<br> <br> Now read the “Backgammon Races” article in the downloads section of this website and you will find Trice’s Rules for evaluating such positions. You will then find that this a redouble and a take.<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis">Cube analysis 2-ply cubeless equity +0.423 0.711 0.000 0.000 - 0.289 0.000 0.000 Cubeful equities: 1. Double, take +0.691 2. Double, pass +1.000 (+0.309) 3. No double +0.676 (-0.015) Proper cube action: Redouble, take </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "CBh"; const probnum = "40"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle2", "ccw"); board.showBoard("XGID=-BDC---------------bbaa-a-:1:1:1:00:0:0:3:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: C/CBq/30.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>ChrisBray</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">2018 - Position 66</span>&ensp; <span>(CBq-30)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Money Play. How should Red play 21?</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Red=117 White=107</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">Obviously Red must hit or he will be attacked himself so 13/11* is clear for the 2. He can minimise blots by 11/10 or 7/6 with the 1.<br> <br> However, Red owns the cube and can use it to powerful effect if White fans. After 13/12, 13/11* followed by a fan by White, Red will redouble and White has the skinniest of takes. After either of the other plays White has a much easier take.<br> <br> Note also that 13/12, 13/11* beautifully triplicates White’s 2s and even his 52 is duplicated. The bottom line is that Red needs his bar-point so he should leave it slotted.<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis"> 1. Cubeful 2-ply 13/12 13/11* Eq.: +0.337 0.560 0.186 0.005 - 0.440 0.199 0.020 2. Cubeful 2-ply 13/11* 7/6 Eq.: +0.272 (-0.065) 0.542 0.188 0.006 - 0.458 0.188 0.012 3. Cubeful 2-ply 13/11*/10 Eq.: +0.249 (-0.088) 0.529 0.184 0.005 - 0.471 0.202 0.012 4. Cubeful 2-ply 13/11* 6/5 Eq.: +0.222 (-0.115) 0.532 0.192 0.006 - 0.468 0.233 0.026 5. Cubeful 0-ply 7/4 Eq.: -0.352 (-0.689) 0.323 0.059 0.001 - 0.677 0.164 0.003 </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "CBq"; const probnum = "30"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle2", "ccw"); board.showBoard("XGID=---BBBCA-bBa-B---b-ccbAb--:1:1:1:12:0:0:3:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: C/CB2/36.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>ChrisBray</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">2014 - Position 86</span>&ensp; <span>(CB2-36)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Money Play. How should Red play 44?</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Red=127 White=170</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">White's timing is precarious so Red should not improve it by hitting the blot on the 17-pt although this would be many players first instinct. White's board is not strong enough to make hitting a necessity.<br> <br> After bar/21 making the 4-pt is the natural play with two more fours becauset hat is the point Red most wants to make.<br> <br> The fourth four could be played 9/5 but making the 9-pt is stronger, effectively creating a partial prime in front of White's checkers on Red's 3-pt.<br> <br> So the correct play is bar/21, 13/9, 8/4(2). Bar/21, 9/5, 8/4(2) is not quite an error but any other play is at least an error.<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis"> 1. Cubeful 2-ply 13/7(2) Eq.: +0.529 0.653 0.124 0.004 - 0.347 0.069 0.002 2. Cubeful 2-ply 13/7 10/7 5/2 Eq.: +0.482 (-0.048) 0.653 0.100 0.002 - 0.347 0.067 0.001 3. Cubeful 2-ply 18/15(2) 10/4 Eq.: +0.454 (-0.076) 0.652 0.061 0.001 - 0.348 0.048 0.000 4. Cubeful 2-ply 18/15(2) 13/10 5/2 Eq.: +0.453 (-0.076) 0.654 0.060 0.001 - 0.346 0.054 0.000 5. Cubeful 2-ply 18/15(2) 13/10(2) Eq.: +0.389 (-0.141) 0.622 0.084 0.003 - 0.378 0.074 0.001 </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "CB2"; const probnum = "36"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle2", "ccw"); board.showBoard("XGID=-bBb-BBBBA-AbB---acbb---aA:1:-1:1:44:0:0:3:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: Z/ZP1/04.html ======================= <reponame>hinacoppy/problemPager <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>BG Quiz</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">Problem of Week: Position 347</span>&ensp; <span>(ZP1-04)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">White to play 54</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips White=143 Black=162</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description"><pre> 1. 18/14 18/13 eq: +0.642 66.64% (G:13.22% B:0.47%) 33.36% (G: 6.04% B:0.20%) 2. 8/3* 7/3 eq: +0.565 (-0.077) 62.92% (G:20.42% B:0.82%) 37.08% (G: 7.29% B:0.27%) 3. 13/9 8/3* eq: +0.406 (-0.236) 59.68% (G:17.58% B:0.74%) 40.32% (G: 9.10% B:0.32%) 4. 13/8 6/2 eq: +0.387 (-0.255) 60.35% (G:14.77% B:0.45%) 39.65% (G: 7.79% B:0.26%) 5. 13/4 eq: +0.340 (-0.302) 59.00% (G:14.35% B:0.49%) 41.00% (G: 8.16% B:0.25%) 6. 7/3* 6/1* eq: +0.319 (-0.322) 57.37% (G:18.02% B:0.65%) 42.63% (G:10.38% B:0.41%) 7. 13/9 6/1* eq: +0.309 (-0.333) 58.04% (G:14.64% B:0.49%) 41.96% (G: 8.72% B:0.32%) </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "ZP1"; const probnum = "04"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle4", "cw"); board.showBoard("XGID=-a-a--EBC---dC-a-cBe------:0:0:1:54:1:0:0:17:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/quizpager.js"></script> </body> </html> ======================= File: Z/ZS4/03.html ======================= <reponame>hinacoppy/problemPager <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>BG Quiz</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">Backgammon Strategy: Position 114</span>&ensp; <span>(ZS4-03)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">White to play 34</div> <div class="gamesituation">w0-b0/5</div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips White=99 Black=70</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description"><pre> 1. 10/7* 7/3 eq: +0.624 82.65% (G: 4.59% B:0.11%) 17.35% (G: 1.73% B:0.05%) 2. 13/9 10/7* eq: +0.618 (-0.006) 82.35% (G: 5.48% B:0.13%) 17.65% (G: 2.90% B:0.07%) 3. 12/8 10/7* eq: +0.547 (-0.078) 79.30% (G: 5.15% B:0.15%) 20.70% (G: 2.12% B:0.03%) 4. 10/7* 6/2 eq: +0.417 (-0.207) 73.60% (G: 6.61% B:0.22%) 26.40% (G: 9.08% B:0.14%) 5. 10/7* 5/1 eq: +0.400 (-0.224) 72.83% (G: 6.84% B:0.20%) 27.17% (G: 8.79% B:0.15%) 6. 6/2 5/2 eq: -0.738 (-1.362) 24.66% (G: 1.11% B:0.03%) 75.34% (G: 5.29% B:0.05%) 7. 12/5 eq: -0.870 (-1.495) 20.18% (G: 0.72% B:0.02%) 79.82% (G: 1.75% B:0.02%) </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "ZS4"; const probnum = "03"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle4", "cw"); board.showBoard("XGID=---BCCCa--A-AB-----cbc-f--:2:-1:1:34:0:0:0:5:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/quizpager.js"></script> </body> </html> ======================= File: C/CBg/44.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>ChrisBray</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">Backgammon in the Wind - Erratum</span>&ensp; <span>(CBg-44)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction"></div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Red=55 White=151</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">This position occurs on page 190 of my latest book, “Backgammon in the Wind”, in the article entitled “Out of the Box”.<br> <br> It is one of the most analysed back game positions of all time as it led to the 17-point match being decided in one game with the cube on 32! I have analysed it many times over the years, first by hand and then using various software programs. In preparing the book for publication this is the one position I did not roll out again but relied on an old rollout.<br> <br> That was a mistake! What was a double a few years ago has now becaome a clear non-double. The position now obeys Kent Goulding's basic principle that you should not double such positions while you still have four points to clear from in front of the two back game anchors. White's timing is tenuous but sufficient for this rule to be obeyed. <NAME> (Red) should have held on to the cube. For <NAME> (White) the take was trivial.<br> <br> On the last roll of the game Sammis held a 16-cube and needed to roll 66 to win. Recognising that being down 16-0 to 17 was hopeless he redoubled to 32 and promptly rolled 66. The match thus entered the history books!<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis">Cube analysis 2-ply cubeless equity +0.570 (Money: +0.559) 0.566 0.338 0.089 - 0.434 0.000 0.000 Cubeful equities: 1. Double, take +0.799 2. Double, pass +1.000 (+0.201) 3. No double +0.764 (-0.034) Proper cube action: Double, take </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "CBg"; const probnum = "44"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle2", "ccw"); board.showBoard("XGID=-bbDDCB----------aacbbb---:0:0:1:00:0:0:0:17:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: T/TC1/21.html ======================= <reponame>hinacoppy/problemPager <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title><NAME></title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">Problem 2-4</span>&ensp; <span>(TC1-21)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Black to play 21</div> <div class="gamesituation">1 point match</div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Black=106 White=113</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">It is hard to steel oneself to play an ugly move like 8/6 2/1 when the more natural 6/3* is available, but White&#39;s board demands respect, even at DMP.<br> In the variant, White&#39;s board has been weakened and the top two plays roll out in a dead heat.<br> <pre> 1. 8/6 2/1 eq: -0.049 47.55% (G:3.86% B:0.02%) 52.45% (G:10.86% B:0.17%) 2. 6/3* eq: -0.109 (-0.060) 44.55% (G:4.09% B:0.04%) 55.45% (G:17.91% B:0.46%) </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "TC1"; const probnum = "21"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle5", "cw"); board.showBoard("XGID=-BBa--DbC----D---aabbbbb--:0:0:1:21:0:0:0:1:1"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/quizpager.js"></script> </body> </html> ======================= File: C/CBo/29.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>ChrisBray</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">2017 - Position 229</span>&ensp; <span>(CBo-29)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Match Play. Red leads 4-1 to 7. Should Red double? If doubled, should White take?</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Red=72 White=79</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">This is a double and take for money and it remains the same at this score. Two points get Red to Crawford with his opponent on an odd number which is very good for him<br> <br> Don’t get put off by the potential redouble to 4 by White. A double is still a double and Red should not be hesitant here. Not doubling is a blunder.<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis">Cube analysis 2-ply cubeless equity +0.498 (Money: +0.498) 0.749 0.000 0.000 - 0.251 0.000 0.000 Cubeful equities: 1. Double, take +0.862 2. Double, pass +1.000 (+0.138) 3. No double +0.768 (-0.093) Proper cube action: Double, take </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "CBo"; const probnum = "29"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle2", "ccw"); board.showBoard("XGID=--ABCDD-A-----a----fdb-b--:0:0:1:D:4:1:0:7:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: Z/ZMa/16.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>BG Quiz</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">Money Move: Position 528</span>&ensp; <span>(ZMa-16)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">White to play 11</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips White=61 Black=115</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description"><pre> 1. 5/3 2/1(2) eq: -0.202 46.73% (G:11.24% B:0.06%) 53.27% (G: 2.68% B:0.10%) 2. 5/4(2) 5/3 eq: -0.218 (-0.016) 46.21% (G:10.13% B:0.06%) 53.79% (G: 2.00% B:0.08%) 3. 5/4(3) 2/1 eq: -0.220 (-0.018) 46.11% (G:10.12% B:0.05%) 53.89% (G: 2.03% B:0.09%) 4. 5/1 eq: -0.238 (-0.036) 45.37% (G:11.52% B:0.06%) 54.63% (G: 3.05% B:0.11%) 5. 4/2 3/2(2) eq: -0.558 (-0.356) 34.84% (G: 7.41% B:0.01%) 65.16% (G: 7.15% B:0.22%) </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "ZMa"; const probnum = "16"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle4", "cw"); board.showBoard("XGID=-CDBBC-a-a--a----cbcbA--b-:1:-1:1:11:0:0:3:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/quizpager.js"></script> </body> </html> ======================= File: Z/ZMb/33.html ======================= <filename>Z/ZMb/33.html <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>BG Quiz</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">Money Move: Position 133</span>&ensp; <span>(ZMb-33)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">White to play 44</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips White=71 Black=50</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description"><pre> 1. 17/5 13/9 eq: -0.844 7.40% (G: 0.00% B:0.00%) 92.60% (G: 1.49% B:0.01%) 2. 22/10 13/9 eq: -0.881 (-0.037) 5.13% (G: 0.00% B:0.00%) 94.87% (G: 0.03% B:0.00%) 3. 17/1 eq: -0.882 (-0.038) 6.06% (G: 0.00% B:0.00%) 93.94% (G: 2.20% B:0.01%) 4. 22/6 eq: -0.889 (-0.044) 4.80% (G: 0.00% B:0.00%) 95.20% (G: 0.02% B:0.00%) 5. 22/14 13/5 eq: -0.883 (-0.039) 5.17% (G: 0.00% B:0.00%) 94.83% (G: 0.03% B:0.00%) 6. 22/18 17/5 eq: -0.884 (-0.039) 5.13% (G: 0.00% B:0.00%) 94.87% (G: 0.03% B:0.00%) 7. 22/18 17/9 13/9 eq: -0.885 (-0.040) 5.09% (G: 0.00% B:0.00%) 94.91% (G: 0.03% B:0.00%) </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "ZMb"; const probnum = "33"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle4", "cw"); board.showBoard("XGID=-GCB---------A---A-bccAdc-:1:1:1:44:86:54:3:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/quizpager.js"></script> </body> </html> ======================= File: Q/QZ6/27.html ======================= <reponame>hinacoppy/problemPager <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>Osaka Open Quiz</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">Problem 7 (cameron Quiz 2005)</span>&ensp; <span>(QZ6-27)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Black to Play 11</div> <div class="gamesituation">b0-w0/5</div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Black=158 White=120</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description"><pre> 1. bar/24 24/23(2) 13/12* Eq.: -0.406 0.4% 7.5% 32.4% 67.6% 20.5% 1.3% 2. bar/22 13/12* Eq.: -0.486 (-0.081) 0.5% 7.7% 32.4% 67.6% 26.9% 1.8% 3. bar/24 13/12*(2) 12/11 Eq.: -0.509 (-0.103) 0.5% 7.8% 30.2% 69.8% 24.1% 2.1% 4. bar/24 13/12*(2) 8/7 Eq.: -0.512 (-0.106) 0.5% 7.1% 31.5% 68.5% 25.8% 2.4% 5. bar/24 13/12*(2) 5/4 Eq.: -0.540 (-0.134) 0.5% 7.1% 31.6% 68.4% 28.1% 2.7% </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "QZ6"; const probnum = "27"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle1", "cw"); board.showBoard("XGID=---a-CC-C---aD--bbcbbb--AA:1:1:1:11:0:0:0:5:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/quizpager.js"></script> </body> </html> ======================= File: C/CB2/25.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>ChrisBray</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">2014 - Position 75</span>&ensp; <span>(CB2-25)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Match Play. DMP. How should Red play 41?</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Red=75 White=123</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description"><NAME> continues to pose excellent and challenging problems on the ABT Facebook account. <br> <br> In a money game (particularly with White owning the cube on 2) the decision would be easier because of the gammon wins and hitting White's blot on Red's 4-pt would be mandatory. The best way to hit is 8/4*, 5/4 as there is some duplication of 3's. This superior to 8/4*/3 because of the additional cover numbers for Red on the next roll.<br> <br> At DMP Gammons don't matter either way so you want the play that wins the most games. This brings 13/8 into contention because it starts to clear the most difficult point. <br> <br> Calculating this over the board is virtually impossible so you have to go by experience and a little bit of gut feel. Back to that old adage –“when in doubt, hit.” It is remarkable just how often the adage is correct.<br> <br> It turns out that 8/4*, 5/4 wins 1.3% more games than 13/8 so that is the right play.<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis"> 1. Cubeful 2-ply 13/8 Eq.: +0.094 0.547 0.163 0.004 - 0.453 0.071 0.001 2. Cubeful 2-ply 8/4* 5/4 Eq.: +0.045 (-0.049) 0.522 0.245 0.002 - 0.478 0.154 0.004 3. Cubeful 2-ply 8/4*/3 Eq.: +0.038 (-0.056) 0.519 0.241 0.002 - 0.481 0.155 0.004 4. Cubeful 2-ply 8/4* 2/1 Eq.: +0.014 (-0.079) 0.507 0.234 0.002 - 0.493 0.163 0.005 5. Cubeful 2-ply 6/5 6/2 Eq.: +0.008 (-0.086) 0.504 0.085 0.000 - 0.496 0.102 0.001 </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "CB2"; const probnum = "25"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle2", "ccw"); board.showBoard("XGID=-CD-aBBcB----B--a--acbbb--:0:0:1:41:0:0:0:1:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: C/CB7/03.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>ChrisBray</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">2015 - Position 3</span>&ensp; <span>(CB7-03)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Match Play. Double Match Point. How should Red play 22?</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Red=126 White=114</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">I got this horribly wrong over the board by playing 13/11, 6/2*, 4/2 which is a blunder. With this move it is difficult to prime White and force him to crack on the other side of the board.<br> <br> The key to the position is to make as many as possible of White’s sixes bad for him so that he is forced to break his prime. My play left only 16 (which my opponent rolled!) whereas 13/9, 7/5(2) (the best move) gives 63, 64 and 66.<br> <br> It is necessary to spot the tactical opportunity afforded by White’s structure on his own side of the board in order to make the correct play. This is an instance where you don’t want to attack a lone checker – you need to let your opponent play with the hope that he will roll an awkward number. My play turned some of his worst numbers into good rolls. Lesson learnt and an instructive position.<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis"> 1. Cubeful 2-ply 13/9 7/5(2) Eq.: -0.284 0.358 0.078 0.002 - 0.642 0.126 0.004 2. Cubeful 2-ply 13/11 7/5(2) 6/4 Eq.: -0.294 (-0.011) 0.353 0.075 0.002 - 0.647 0.125 0.004 3. Cubeful 2-ply 7/5(2) 6/2* Eq.: -0.304 (-0.020) 0.348 0.079 0.002 - 0.652 0.175 0.007 4. Cubeful 2-ply 13/11 7/5(2) 4/2* Eq.: -0.326 (-0.042) 0.337 0.076 0.002 - 0.663 0.172 0.007 5. Cubeful 2-ply 13/11 7/5(2) 3/1 Eq.: -0.326 (-0.042) 0.337 0.067 0.002 - 0.663 0.097 0.003 </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "CB7"; const probnum = "03"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle2", "ccw"); board.showBoard("XGID=--aAC-DBB----A--cbbcc-B-a-:1:-fd00:c2b6:b24b:be67:2827:688d:e6a1:6a3b"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: C/CBy/44.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>ChrisBray</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">2019 - Position 194</span>&ensp; <span>(CBy-44)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Money Play. How should Play 53?</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Red=97 White=150</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">Once you find 10/2 the play becomes obvious. The key is to consider it as a candidate play.<br> <br> If White hits he will still be behind a prime with much work to do. If White fans, Red can quickly complete a closeout and win a gammon.<br> <br> Any move other than 10/2 is a double blunder.<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis"> 1. Cubeful 2-ply 10/2 Eq.: +0.574 0.659 0.445 0.007 - 0.341 0.077 0.004 2. Cubeful 2-ply 10/5 4/1 Eq.: +0.518 (-0.056) 0.648 0.406 0.005 - 0.352 0.065 0.003 3. Cubeful 2-ply 8/5 8/3 Eq.: +0.479 (-0.095) 0.634 0.404 0.007 - 0.366 0.072 0.004 4. Cubeful 2-ply 6/3 6/1 Eq.: +0.456 (-0.118) 0.641 0.349 0.004 - 0.359 0.054 0.003 5. Cubeful 2-ply 10/5 8/5 Eq.: +0.438 (-0.137) 0.625 0.389 0.008 - 0.375 0.076 0.004 </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "CBy"; const probnum = "44"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle2", "ccw"); board.showBoard("XGID=aA-BBDBbB-A-a-b--c-c-c--A-:1:-1:1:53:0:0:3:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: C/CC8/46.html ======================= <filename>C/CC8/46.html <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>ChrisBray</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">2021 - Position 146</span>&ensp; <span>(CC8-46)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Match Play. Red leads 2-0 to 7. How should Red play 65?</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Red=115 White=123</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">This is closer than it looks but the old adage of ‘sixes don’t grow on trees’ applies here.<br> <br> The correct play 24/13*. If White doesn’t roll one of his 21 hitting numbers then Red looks good. 10/4, 8/3 is only just an error but an error still the same. <br> <br> White is the favourite in this position so Red needs to take some action to try toc change that. 24/13* is the play.<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis"> 1. Cubeful 2-ply 24/13* Eq.: -0.317 0.414 0.057 0.002 - 0.586 0.262 0.010 2. Cubeful 2-ply 10/4 8/3 Eq.: -0.380 (-0.063) 0.317 0.069 0.001 - 0.683 0.128 0.003 3. Cubeful 2-ply 8/2 6/1 Eq.: -0.458 (-0.141) 0.297 0.069 0.001 - 0.703 0.158 0.004 4. Cubeful 2-ply 10/4 6/1 Eq.: -0.533 (-0.215) 0.271 0.063 0.001 - 0.729 0.166 0.004 5. Cubeful 2-ply 8/3 8/2 Eq.: -0.559 (-0.242) 0.269 0.067 0.001 - 0.731 0.187 0.005 </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "CC8"; const probnum = "46"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle2", "ccw"); board.showBoard("XGID=--AABbD-C-C-aa---b-cbbb-A-:1:1:1:65:2:0:0:7:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: Z/ZS4/44.html ======================= <reponame>hinacoppy/problemPager <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>BG Quiz</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">Backgammon Strategy: Position 161</span>&ensp; <span>(ZS4-44)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">White to play 21</div> <div class="gamesituation">w3-b4/5</div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips White=122 Black=97</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description"><pre> 1. 5/3 2/1* eq: -0.546 37.74% (G:12.20% B:0.15%) 62.26% (G:15.04% B:0.67%) 2. 5/4 5/3 eq: -0.614 (-0.068) 33.84% (G: 9.02% B:0.22%) 66.16% (G:14.54% B:0.62%) 3. 5/3 4/3 eq: -0.637 (-0.091) 32.83% (G: 8.21% B:0.17%) 67.17% (G:14.70% B:0.62%) 4. 5/2 eq: -0.648 (-0.102) 33.00% (G: 7.48% B:0.17%) 67.00% (G:15.42% B:0.54%) 5. 6/5 6/4 eq: -0.698 (-0.152) 30.49% (G: 5.74% B:0.12%) 69.51% (G:15.38% B:0.59%) 6. 6/4 2/1* eq: -0.761 (-0.214) 28.53% (G: 6.25% B:0.10%) 71.47% (G:16.56% B:0.72%) 7. 6/4 5/4 eq: -0.787 (-0.241) 27.23% (G: 5.41% B:0.12%) 72.77% (G:16.60% B:0.65%) </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "ZS4"; const probnum = "44"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle4", "cw"); board.showBoard("XGID=--Ab-CCCB----B-----beb-dA-:0:0:-1:21:3:4:1:5:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/quizpager.js"></script> </body> </html> ======================= File: C/CBu/18.html ======================= <filename>C/CBu/18.html <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>ChrisBray</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">Baker Street Christmas</span>&ensp; <span>(CBu-18)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction"></div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Red=200 White=117</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">Christmas Day at 221B is always a pleasurable experience. As ever, <NAME> had provided a superb turkey lunch. Holmes and I had eaten more than our fill but that didn’t stop us from enjoying a glass of port to complete matters.<br> <br> Outside Baker Street was very quiet as the snow deadened the sounds of the horses’ hooves and the wheels of the Hansom cabs, so that hardly a sound reached us as we chatted in front of the roaring fire. After briefly discussing Holmes’ current cases our conversation turned, as it often did, to the topic of backgammon.<br> <br> “Holmes, I still do not seem to be playing back games very well and I think that I am not maximising my chances in many of the back games that I play.”<br> <br> “Do you have a specific position in mind, my dear Watson?” enquired Holmes.<br> <br> “Several but let us look at this position from a game I played against Inspector Lestrade last week.” And, so saying I set up the board as you see it above. Black has to play double fours.<br> <br> “My thinking was that I couldn’t hold all three points in Lestrade’s home board, so I decided to give one of them up with this roll of 44 to guarantee my timing in 1-4 back game. I chose 20/16(2), 13/9(2) but the game did not go well. I took Lestrade’s double a couple of rolls later and went on to lose a gammon.”<br> <br> “Back games like this are relatively uncommon,” said Holmes. “They require careful handling to maximise the chances for the back game player. As the position stands Black does not know which back game will serve him best and although the 1-4 game is the most likely outcomes it could be that a 4-5 game will work better.<br> <br> “Note that in this initial position White has five checkers on his 6-pt that he would like to get into play. If you vacate his 5-pt prematurely those checkers have somewhere they can usefully go to. The key to back games like this one is to maintain flexibility and choice for as long as possible. There is even a chance that, if Black were to catch up in the race, the game will transpose to a holding game rather than a back game.<br> <br> “Your error, Watson, was to commit to a game plan before it was clear exactly what that plan should be. The best move in this position is 13/9, 11/3, 7/3. This allows Black to maintain all his options and because of the disjointed nature of White’s position he should have no trouble running off whichever anchor he chooses to give up. By strengthening his home board Black will create some variations where he hits White a couple of times, catches up in the race, and wins by going forward rather than relying on back game.”<br> <br> “Good heavens, Holmes’ I remarked, ‘you see so much more in a position than I ever could.”<br> <br> “Study and practice are vital, Watson. Even I could not ever have become a strong player without many hours of study and many more hours of practice. Next year you should spend more time on the game.”<br> <br> “An excellent suggestion, Holmes. I will certainly do that. And now, perhaps, just one more glass of port?”<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis"> 1. Cubeful 2-ply 13/9 11/3 7/3 Eq.: -0.096 0.499 0.105 0.004 - 0.501 0.198 0.013 2. Cubeful 2-ply 13/9(2) 11/3 Eq.: -0.132 (-0.036) 0.488 0.102 0.004 - 0.512 0.199 0.013 3. Cubeful 2-ply 13/5 13/9 11/7 Eq.: -0.134 (-0.038) 0.488 0.102 0.004 - 0.512 0.201 0.013 4. Cubeful 2-ply 13/5 11/3 Eq.: -0.153 (-0.058) 0.486 0.101 0.004 - 0.514 0.212 0.016 5. Cubeful 2-ply 13/5 13/9 7/3 Eq.: -0.157 (-0.061) 0.481 0.100 0.004 - 0.519 0.202 0.013 </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "CBu"; const probnum = "18"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle2", "ccw"); board.showBoard("XGID=----ABBA---AbBc--c-eBB-bB-:0:0:1:44:0:0:3:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: C/CBu/10.html ======================= <gh_stars>0 <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>ChrisBray</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">2018 - Position 214</span>&ensp; <span>(CBu-10)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Match Play. Red leads 3-1 to 7. Should Red double? If doubled, should White take?</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Red=143 White=169</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">Beware the perfectly efficient gammon!<br> <br> What is an easy take for money becomes a big pass at this match score. A gammon for Red gives the match exactly. White must pass and play from 1-4 down. Better that than not to be in the match at all!<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis">Cube analysis 2-ply cubeless equity +0.630 (Money: +0.556) 0.674 0.253 0.009 - 0.326 0.053 0.001 Cubeful equities: 1. Double, pass +1.000 2. Double, take +1.021 (+0.021) 3. No double +0.879 (-0.121) Proper cube action: Double, pass </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "CBu"; const probnum = "10"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle2", "ccw"); board.showBoard("XGID=-aa-B-CBC---dCb--c-dB-----:0:0:1:00:3:1:0:7:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: Z/ZMf/28.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>BG Quiz</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">Money Move: Position 187</span>&ensp; <span>(ZMf-28)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">White to play 44</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips White=137 Black=134</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description"><pre> 1. 13/1 7/3 eq: -0.458 27.81% (G: 7.04% B:0.07%) 72.19% (G:17.69% B:0.71%) 2. 13/9 8/4(2) 7/3 eq: -0.481 (-0.022) 27.16% (G: 7.04% B:0.08%) 72.84% (G:18.54% B:0.73%) 3. 13/1 6/2 eq: -0.497 (-0.038) 26.83% (G: 6.46% B:0.06%) 73.17% (G:18.55% B:0.78%) 4. 13/1 8/4 eq: -0.497 (-0.038) 27.23% (G: 6.40% B:0.06%) 72.77% (G:19.35% B:0.89%) 5. 13/9 8/4(2) 6/2 eq: -0.506 (-0.048) 26.12% (G: 6.50% B:0.10%) 73.88% (G:17.94% B:0.75%) 6. 13/9 8/4 7/3 6/2 eq: -0.511 (-0.052) 27.27% (G: 7.29% B:0.13%) 72.73% (G:21.50% B:1.13%) 7. 13/5 8/4(2) eq: -0.514 (-0.056) 26.21% (G: 6.68% B:0.11%) 73.79% (G:19.13% B:0.78%) </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "ZMf"; const probnum = "28"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle4", "cw"); board.showBoard("XGID=a-B-B-DAB---cA---bcccAB---:1:1:1:44:0:0:3:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/quizpager.js"></script> </body> </html> ======================= File: C/CBg/27.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>ChrisBray</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">2016 - Position 176</span>&ensp; <span>(CBg-27)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Match Play. 4-4 to 7. Should Red double? If doubled, should White take?</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Red=137 White=155</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">For money this is a very clear double because of the volatility but also a very a clear take as the cube has full value to White. Dropping would be a blunder.<br> <br> At this score things are very different. The general rule at 3-away, 3-away is double earlier than usual and drop earlier than usual. With lots of gammons in the air taking here would be a double blunder. However, Red is not nearly good enough to play on for an undoubled gammon and not doubling this position is very nearly a double blunder.<br> <br> The position reinforces just how much influence the match score in doubling decisions in short matches.<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis">Cube analysis 2-ply cubeless equity +0.717 (Money: +0.570) 0.647 0.353 0.007 - 0.353 0.081 0.004 Cubeful equities: 1. Double, pass +1.000 2. Double, take +1.062 (+0.062) 3. No double +0.822 (-0.178) Proper cube action: Double, pass </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "CBg"; const probnum = "27"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle2", "ccw"); board.showBoard("XGID=aBaB-BB-A---cD---cbe---AA-:fc00:db20:35b:7399::5:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: C/CBu/07.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>ChrisBray</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">More on Broken Primes</span>&ensp; <span>(CBu-07)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction"></div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Red=120 White=112</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">This position occurred this week when I was running a training session for relative beginners. All of the class gave virtually no thought to doubling this position as Black, but I stopped them rolling so we could do some analysis. Long experience of broken primes over the last few years has taught me just how powerful they can be. <br> <br> My students did not have the benefit of having a huge number of similar reference positions to call upon, but I did. Remember that most doubling decisions are made by reference to one’s store of backgammon knowledge. Of course, we add calculation on top of the initial subjective analysis to arrive at a decision, but you cannot play top-class backgammon without having a personal library of thousands of reference positions.<br> <br> A beginner looking at this position sees only White’s five-and-a-half-point home board and does no further analysis.<br> <br> An expert sees more. Firstly, any 2 by Black is nearly always a winning roll. However, if Black fans, White needs to a number of things to win the game. He needs to cover the blot on his 2-pt, he then needs to escape two checkers from behind a broken prime. To do that he will need to roll two 2’s and then two 5’s or 6’s.<br> <br> That is a lot to ask while all the time Black is threatening to roll a two and probably win the game. When you need to do a number of things to win a game the percentage chance of doing so is the product of the chances of the individual events occurring. <br> <br> If things do go well for White, he will win some gammons and that must be taken into consideration as well. The position is highly volatile so if it is a double Black should be doubling now and not after he rolls the winning 2.<br> <br> My opinion was that this was indeed a correct double for Black. My students were somewhat surprised by this but agreed to double. Black went on to win a gammon. In fact, Black wins this position two-thirds of the time and about a quarter of those wins are gammons. White wins the rest of the games and a third of his wins are also gammons. <br> <br> A long rollout shows that the double is correct, and it is an error not to double now. The take is, of course, very easy. I would not expect many players to drop as White, but you never know in backgammon. The key point is to be able to recognise that Black has a double in the initial position and to be able to do that you need a reasonable amount of experience. That is why both playing experience and hours of study are necessary to become an expert at the game.<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis">There are no legal moves. </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "CBu"; const probnum = "07"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle2", "ccw"); board.showBoard("XGID=--bB-CCBB---bB-----bbbbabA:0:0:1:34:0:0:3:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: C/CBm/20.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>ChrisBray</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">2017 - Position 139</span>&ensp; <span>(CBm-20)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Match Play. Red trails 2-5 to 7. Should Red double? If doubled, should White take?</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Red=153 White=148</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">Two points get White to the match very efficiently so he should certainly consider taking.<br> <br> On the downside four points get Red to the Crawford Game and maybe that is too risky?<br> <br> Red is the favourite but is yet to hit the second checker and is not favourite to do so. Meanwhile White has only one checker back and all his checkers in play. Red has only eight static checkers in the attack zone. For money a double would be premature here. <br> <br> Red does win 20% gammons but even that is not enough to make this a drop for White. Of course, Red should double because of the volatility and the match score. Even at 3-5 the correct actions are double and take. Dropping here is a blunder.<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis">Cube analysis 2-ply cubeless equity +0.293 (Money: +0.399) 0.638 0.203 0.007 - 0.362 0.084 0.003 Cubeful equities: 1. Double, take +0.799 2. Double, pass +1.000 (+0.201) 3. No double +0.713 (-0.086) Proper cube action: Double, take </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "CBm"; const probnum = "20"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle2", "ccw"); board.showBoard("XGID=-a--BBBB----eEa--b-dAb--A-:fc00:e968:6179::de52:7100:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: C/CC1/12.html ======================= <gh_stars>0 <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>ChrisBray</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">2020 - Position 12</span>&ensp; <span>(CC1-12)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Money Play. How should Red play 64?</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Red=145 White=164</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">Running off the anchor with 21/11 is the wrong idea.<br> <br> The right idea is to strengthen the home board before attempting to run. ‘Put them where you want them’ is a useful backgammon maxim. Here that works beautifully and Red should play 10/4, 8/4.<br> <br> This creates a strong four-point prime and the blots left exposed are not in much danger, especially as White would have to give up Red’s bar-point to hit.<br> <br> Any play other than 10/4, 8/4 is a blunder or worse.<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis"> 1. Cubeful 2-ply 10/4 8/4 Eq.: +0.568 0.619 0.224 0.007 - 0.381 0.067 0.001 2. Cubeful 2-ply 21/11 Eq.: +0.482 (-0.086) 0.623 0.163 0.006 - 0.377 0.074 0.002 3. Cubeful 2-ply 10/6 10/4 Eq.: +0.408 (-0.160) 0.593 0.192 0.006 - 0.407 0.073 0.002 4. Cubeful 2-ply 13/3 Eq.: +0.395 (-0.173) 0.597 0.188 0.005 - 0.403 0.080 0.002 5. Cubeful 0-ply 21/15 10/6 Eq.: +0.282 (-0.286) 0.570 0.181 0.008 - 0.430 0.099 0.004 </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "CC1"; const probnum = "12"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle2", "ccw"); board.showBoard("XGID=-a-B-BBbB-B-cCa--c-e-B----:fdf8:f53e:61e4::18:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: K/KA8/33.html ======================= <gh_stars>0 <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>michy problem</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">ベアイン その3</span>&ensp; <span>(KA8-33)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">マネーゲームで黒に32が出ました。</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips 黒=75 白=84</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">一昨日の続きですね。<br> <br> 『Crowns Cup』がベルリンで開催されます。またもや超弩級のギャモントーナメントです。詳しくは望月氏のブログを参照のこと。<br> <br> key><br> 8/6,4/1<br> やはり6ポイントにスペアが欲しい。それを満たしつつ、攻撃材料は3枚あるという、理想的な格好ですね。<br> <br> bluex2><br> 8/6 4/1でいってみます。<br> <br> 1pメイクして相手が6を振ってブロットを残したとしても、攻撃できる駒の数は大したことはないので、あまりメリットがないように思うので1pメイクは止めておきます。<br> 相手のインナー外の駒はたったの2枚なので、インナーが崩れるのをヒットしてギャモン、という展開も望めないこの形では素直に勝率を上げにかかるしかないと思います。<br> となれば、最後尾を外しやすくするべく8/6、3の目は安全な中では最も効率のよい(1pギャップ埋められる)4/1にします。<br> <br> nori><br> 実戦だと手拍子でaceを作りそう。<br> スペア大事。ということで8/6 4/1で<br> <br> vin><br> 8/6 4/1<br> <br> なるほど。スペアを残すのか。<br> カンニングになりましたが、勉強になるなあ。<br> 実践では、無造作に ace 作ってしまうと思います。<br> <br> 西本><br> 次、多分、白は、一枚飛び出すでしょう。<br> 問題は、残った白を打ちに行くかどうかですね。<br> <br> まず、とりあえずはピップを数えます。<br> 白:44+40=84<br> 黒:(60-3)+10+8=75<br> 5ピップ進むと、14ピップ差。有利ですね!<br> というわけで、残った白は、打ちに行きません。<br> <br> すれ違いに行くなら、まずは66で割れないように8/6。<br> あとは、1ptのギャップを埋める4/1が良さそう。<br> <br> 8/6 4/1。<br> <br> yu><br> 8/6 4/1<br> <br> ベアイン&1を埋められるので。<br> <br> shun><br> 4/1 3/1<br> <br> 理由:天邪鬼なので、みんなと違う答えを書きたい。もとい、敵が1駒逃げ出し後のひき逃げを考えるとエースを埋めておきたい。マネーゲームだし~。<br> <br> H.S><br> ここは、すれ違い狙いで。<br> 4/1と3/1を考えたのですが<br> ・白が4ゾロ以上出してレースに持ちこんだ際に5枚インナーに入れるのと4枚では差が出る<br> ・実は6ゾロが怖い<br> があるので、8/6と4/1でいいのかなーと。<br> また、西本さんと同じく、白が1枚残す展開になった場合は、5ポイントにポイントオン(1・2・3の組み合わせ)できるような状態にならない限り、ヒットしない方針がいいかなと感じています。(1ポイントのブロットも白にとっては『大逆転』の可能性を残すため)<br> <br> takamasa><br> 8/6 4/1 盤上この一手!かな。<br> <br> michihito先生の教え通り(? 間違って理解してたり?(笑))、ピップがそれほど大きな差がある訳ではない(それでも黒が相当有利に変わりはないですが)ので、アクティブビルダー増計画で。<br> <br> 原則として、ピップ進んでいる方は、早くすれ違いたい、遅れている方は、後ろのコマは動かさずいたい、だと思いますが、この局面は、白としても、ピップ不利でも早くすれ違わないとますます勝率を落とす局面だと思います(キューブ持ってるので最後まで振れる利もある)。黒は、多少攻撃して、勝率を上げたいと思う局面。黒も単純に、安全のみという局面ではないのだと思います。バックマン片方逃げられ対策からも、、<br> <br> 8/6 4/1に一票!<br> <br> rebasasi><br> 8/6 4/1です。<br> 次に割れる目がないし、1に1つくらい置いときたいので。<br> <br> michihito_k><br> まず3の目は4/1で決まりです。<br> 他にこれ以上駒の働きを良くする手はありません。<br> さて2の目が問題です。<br> 3/1と8/6のどちらもが駒の働きを良くしていますね。<br> 次に白がバックマン1枚だけを残す展開が多いので、その場合にどちらがアタック<br> しやすいか比較しましょう。<br> <br> ・ 3/1の場合<br> 最高の目(クローズアウト)5通り(11 22 33 23)<br> 良い目(ひき逃げ)8通り(21 24 31 34)<br> <br> ・ 8/6の場合<br> 最高の目(フルプライム)5通り(11 22 33 13)<br> 良い目(ヒット&カバー)6通り(14 24 34)<br> <br> エースポイントを埋める方が次に攻撃しやすいかと思いきや、2通りの差しか<br> 生じていません。<br> 僅かこれだけの違いならば、次の理由から明らかに8/6が勝ります。<br> (1) 1枚ベアインしている<br> (2) フレキシビリティーに勝り、特に次の66 55 44で大差が生じる<br> <br> 最善手:8/6 4/1<br> <br> 私の得た教訓:<br> アタックする場合、インナーブロットを気にするよりもフレキシビリティー重視。<br> <br> michihito_k><br> 西本さん、黒はピップでリードしていますが、大差ではないので、攻撃する展開が<br> 十分あり得ます。<br> 最善手を選んだ後で白が1枚だけ飛び出した場合、黒は12 23を振れば、<br> 危険を冒してもポイントオンするべきです!<br> <br> shunさん、やはり天の邪鬼だったんですね(笑)。<br> <br> ロールアウト結果は次の通り。<br> <br> 1. M 8/6 4/1 Eq.: 0.525<br> 0.0% 1.6% 76.1% 23.9% 0.5% 0.0%<br> - money cubeless eq.: 0.533 ア0.006.<br> 2. M 4/1 3/1 Eq.: 0.449 (-0.077)<br> 0.0% 1.2% 72.5% 27.5% 0.1% 0.0%<br> - money cubeless eq.: 0.460 ア0.006.<br> Rollout settings:<br> Truncated rollout, depth 11,<br> 180 games (equiv. 68655 games),<br> played 2-ply (precise),<br> random seed, with race database.<br> <br> 正答数はvinさん26個、H.Sさん24個、bluex2さん19個、keyさん18個となっています。<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis"> 1. Cubeful 2-ply 11/1*(2) Eq.: +0.401 0.590 0.207 0.006 - 0.410 0.113 0.003 2. Cubeful 2-ply 13/3(2) Eq.: +0.392 (-0.009) 0.606 0.184 0.009 - 0.394 0.114 0.003 3. Cubeful 2-ply 13/8 11/1* 6/1 Eq.: +0.354 (-0.047) 0.583 0.199 0.007 - 0.417 0.120 0.003 4. Cubeful 2-ply 13/3 11/6 8/3 Eq.: +0.276 (-0.125) 0.577 0.183 0.009 - 0.423 0.132 0.004 5. Cubeful 0-ply 13/3 8/3 6/1* Eq.: +0.152 (-0.249) 0.538 0.191 0.009 - 0.462 0.151 0.006 </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "KA8"; const probnum = "33"; const showpipflg = false; const board = new BgBoard("#board", "boardStyle5", "ccw"); board.showBoard("XGID=--BCCbBBC----------bbbbcb-:1:-1:1:32:0:0:3:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: Z/ZP6/45.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>BG Quiz</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">Problem of Week: Position 36</span>&ensp; <span>(ZP6-45)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">White to play 51</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips White=146 Black=145</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description"><pre> 1. 10/5 6/5 eq: +0.478 60.54% (G:17.67% B:0.41%) 39.46% (G: 5.68% B:0.18%) 2. 21/16* 16/15 eq: +0.396 (-0.081) 59.69% (G:16.88% B:0.76%) 40.31% (G: 9.27% B:0.41%) 3. 21/16* 8/7 eq: +0.394 (-0.084) 59.93% (G:16.26% B:0.69%) 40.07% (G: 9.16% B:0.39%) 4. 21/20 21/16* eq: +0.378 (-0.099) 59.57% (G:15.92% B:0.69%) 40.43% (G: 9.16% B:0.39%) 5. 21/16* 10/9 eq: +0.256 (-0.221) 56.79% (G:15.02% B:0.59%) 43.21% (G:10.14% B:0.45%) 6. 21/16* 6/5 eq: +0.223 (-0.255) 55.66% (G:14.68% B:0.55%) 44.34% (G:11.58% B:0.63%) 7. 10/9 8/3* eq: +0.077 (-0.401) 50.95% (G:13.50% B:0.36%) 49.05% (G: 8.79% B:0.26%) </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "ZP6"; const probnum = "45"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle4", "cw"); board.showBoard("XGID=---a--EBC-A-dB--ad-e-B----:fd00:c2b6:b24b:be67:2827:688d:e6a1:6a3b:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/quizpager.js"></script> </body> </html> ======================= File: Z/ZMe/29.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>BG Quiz</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">Money Move: Position 268</span>&ensp; <span>(ZMe-29)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">White to play 53</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips White=137 Black=119</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description"><pre> 1. 13/10 9/4 eq: +0.441 60.86% (G:13.81% B:0.50%) 39.14% (G: 5.59% B:0.13%) 2. 9/4 8/5 eq: +0.386 (-0.054) 60.06% (G:12.80% B:0.35%) 39.94% (G: 5.84% B:0.13%) 3. 13/5 eq: +0.376 (-0.064) 59.70% (G:14.32% B:0.55%) 40.30% (G: 8.35% B:0.17%) 4. 13/8 9/6 eq: +0.339 (-0.102) 58.73% (G:12.45% B:0.35%) 41.27% (G: 5.64% B:0.12%) 5. 9/1 eq: +0.307 (-0.134) 58.17% (G:14.32% B:0.36%) 41.83% (G: 7.67% B:0.14%) 6. 13/10 13/8 eq: +0.293 (-0.148) 57.91% (G:14.02% B:0.65%) 42.09% (G: 8.43% B:0.13%) 7. 9/4 5/2 eq: +0.066 (-0.375) 52.07% (G:11.19% B:0.26%) 47.93% (G:10.62% B:0.28%) </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "ZMe"; const probnum = "29"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle4", "cw"); board.showBoard("XGID=---bBBB-DA---B-b-c-cBabaa-:0:0:1:53:0:0:3:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/quizpager.js"></script> </body> </html> ======================= File: Z/ZM6/20.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>BG Quiz</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">Money Move: Position 73</span>&ensp; <span>(ZM6-20)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">White to play 32</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips White=151 Black=129</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description"><pre> 1. 13/10 7/5* eq: -0.445 39.44% (G:10.48% B:0.25%) 60.56% (G:18.22% B:0.84%) 2. 7/4 7/5* eq: -0.580 (-0.135) 34.93% (G: 8.67% B:0.20%) 65.07% (G:15.71% B:0.58%) 3. 7/5* 5/2 eq: -0.596 (-0.150) 34.63% (G: 8.13% B:0.18%) 65.37% (G:15.92% B:0.66%) 4. 7/5* 6/3 eq: -0.586 (-0.141) 34.10% (G: 8.16% B:0.12%) 65.90% (G:17.19% B:0.62%) 5. 22/20 13/10 eq: -0.695 (-0.250) 31.85% (G: 5.99% B:0.17%) 68.15% (G:15.32% B:0.52%) 6. 22/20 6/3 eq: -0.745 (-0.300) 29.64% (G: 5.24% B:0.15%) 70.36% (G:12.00% B:0.36%) 7. 13/8 eq: -0.775 (-0.330) 28.83% (G: 5.33% B:0.14%) 71.17% (G:11.74% B:0.34%) </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "ZM6"; const probnum = "20"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle4", "cw"); board.showBoard("XGID=---BBaCB----bC--cc-d-bC---:0:0:1:32:0:0:3:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/quizpager.js"></script> </body> </html> ======================= File: K/KE9/10.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>keeae</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">前回のポジションを踏まえて</span>&ensp; <span>(KE9-10)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction"></div> <div class="gamesituation">b2-w0/7</div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips b=118 w=187</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">このポジションは前回のポジションの少し前の段階です。という事で考える点もよく似ているので察しが付くのではないでしょうか。エースをカバーしている場合ではなく、できれば5ポイントを作るか自らヒットされて進みすぎないようタイミングを遅らせたいことから5ポイントスロットがよいムーブとなっています。<br> <br> 1. bar/20*/5 Eq.: +0.277<br> 0.522 0.309 0.027 - 0.478 0.073 0.002 CL +0.298 CF +0.277<br> <br> 2. bar/20*/10 13/8 Eq.: +0.198 ( -0.079)<br> 0.502 0.307 0.025 - 0.498 0.077 0.002 CL +0.249 CF +0.198<br> <br> 3. bar/20*/15 13/8(2) Eq.: +0.163 ( -0.114)<br> 0.496 0.299 0.026 - 0.504 0.083 0.002 CL +0.225 CF +0.163<br> <br> 4. bar/20*/10 6/1 Eq.: +0.156 ( -0.120)<br> 0.486 0.316 0.024 - 0.514 0.076 0.002 CL +0.226 CF +0.156<br> <br> 5. bar/20*/15 13/8 6/1 Eq.: +0.148 ( -0.129)<br> 0.485 0.318 0.026 - 0.515 0.083 0.003 CL +0.221 CF +0.148<br> <br> 6. bar/20* 13/8(2) 6/1 Eq.: +0.147 ( -0.130)<br> 0.484 0.323 0.028 - 0.516 0.085 0.003 CL +0.224 CF +0.147<br> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "KE9"; const probnum = "10"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle1", "cw"); board.showBoard("XGID=-AcbC-DBB---bBa--a-ca-b--A:0:0:1:55:2:0:0:7:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/keeaepager.js"></script> </body> </html> ======================= File: C/CBy/26.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>ChrisBray</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">2019 - Position 176</span>&ensp; <span>(CBy-26)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Money game. Should Red redouble? If redoubled, should White take?</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Red=148 White=135</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">Is the power of the broken prime plus two opponent checkers on the bar sufficient to combat a pure five-point prime?<br> <br> If gammons didn’t count White could take this redouble but he loses a gammon 25% of the time from here. White needs too many things to go right for him to be able to take this cube. Instead he must take his medicine and pass. Taking is actually a blunder.<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis">Cube analysis 2-ply cubeless equity +0.594 0.721 0.232 0.014 - 0.279 0.089 0.006 Cubeful equities: 1. Double, take +0.999 2. Double, pass +1.000 (+0.001) 3. No double +0.881 (-0.118) Proper cube action: Redouble, take </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "CBy"; const probnum = "26"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle2", "ccw"); board.showBoard("XGID=b-a-B-CBBB---A-A--bdbbbB--:1:1:1:00:0:0:3:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: G/GP3/49.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>GMA</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">第31回(gma) - 問4</span>&ensp; <span>(GP3-49)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">黒の手番です。32 はどう動かしますか?</div> <div class="gamesituation">4-2:7pt</div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Black=133 White=115</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description"><pre> 1. 13/10 12/10 eq:+0.128 53.68% (G:3.37% B:0.14%) 46.32% (G: 7.24% B:0.09%) 2. 12/9 11/9 eq:+0.078 (-0.050) 50.73% (G:2.83% B:0.07%) 49.27% (G: 5.76% B:0.11%) 3. 13/11 13/10 eq:+0.105 (-0.023) 54.06% (G:4.06% B:0.10%) 45.94% (G: 9.92% B:0.14%) 4. 13/11 12/9 eq:+0.084 (-0.044) 52.21% (G:3.39% B:0.07%) 47.79% (G: 8.32% B:0.08%) 5. 13/10 8/6 eq:-0.034 (-0.162) 48.39% (G:4.17% B:0.10%) 51.61% (G:10.46% B:0.23%) </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "GP3"; const probnum = "49"; const showpipflg = false; const board = new BgBoard("#board", "boardStyle6", "cw"); board.showBoard("XGID=-a--B-C-D--AADb--cacbab---:1:1:1:32:4:2:0:7:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/quizpager.js"></script> </body> </html> ======================= File: K/KE8/45.html ======================= <filename>K/KE8/45.html <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>keeae</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">積み木崩し</span>&ensp; <span>(KE8-45)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction"></div> <div class="gamesituation">b0-w0/7</div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips b=114 w=155</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">こちらのプライムにはもう遊びがないので4を振った今バックマンに手をかけないとインナーがクラッシュしてしまう。残りの2の目でセミプラのエッジを崩した形にすればプライムの威力をあまり損なわずに済む。<br> <br> 1. 22/18 3/1 Eq.: -0.054<br> 0.544 0.185 0.010 - 0.456 0.156 0.010 CL +0.127 CF -0.054<br> <br> 2. 22/18 8/6 Eq.: -0.281 ( -0.227)<br> 0.464 0.161 0.010 - 0.536 0.154 0.008 CL -0.057 CF -0.281<br> <br> 3. 7/5 7/3 Eq.: -0.424 ( -0.370)<br> 0.418 0.133 0.005 - 0.582 0.134 0.005 CL -0.160 CF -0.424<br> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "KE8"; const probnum = "45"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle1", "cw"); board.showBoard("XGID=--cBCBBBB---a---cb-bbbB---:1:-1:1:24:0:0:0:7:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/keeaepager.js"></script> </body> </html> ======================= File: Z/ZMe/36.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>BG Quiz</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">Money Move: Position 721</span>&ensp; <span>(ZMe-36)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">White to play 62</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips White=142 Black=154</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description"><pre> 1. 24/22 10/4 eq: +0.5071 66.26% (G:35.95% B:0.34%) 33.74% (G: 5.86% B:0.27%) 2. 13/11 10/4 eq: +0.5052 (-0.0018) 65.72% (G:37.49% B:0.35%) 34.28% (G: 6.25% B:0.33%) 3. 10/4 8/6 eq: +0.4899 (-0.0172) 65.80% (G:35.32% B:0.30%) 34.20% (G: 5.82% B:0.28%) 4. 8/2 4/2 eq: +0.3954 (-0.1116) 63.07% (G:33.89% B:0.39%) 36.93% (G: 7.43% B:0.42%) 5. 13/7 8/6 eq: +0.0848 (-0.4222) 54.62% (G:26.26% B:0.44%) 45.38% (G:10.64% B:0.81%) 6. 13/7 10/8 eq: +0.0798 (-0.4273) 54.50% (G:25.58% B:0.44%) 45.50% (G:10.30% B:0.69%) 7. 24/22 13/7 eq: +0.0652 (-0.4419) 54.38% (G:26.50% B:0.47%) 45.62% (G:12.04% B:1.07%) </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "ZMe"; const probnum = "36"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle4", "cw"); board.showBoard("XGID=aB-BA-B-A-A-eD-a-c-e----B-:1:-1:1:62:0:1:3:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/quizpager.js"></script> </body> </html> ======================= File: B/BR9/49.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>501</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">26. ギャモンセーブ</span>&ensp; <span>(BR9-49)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">No.427 Blue to play 33</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips b=128 w=22</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">501:ギャモン負けを逃れられそうなときは、ギャモン負けしないようにプレイすることが最善だ。勝つための最善は(ヒットできたときのために)6/3(2), 5/2(2)だ。しかし、ギャモン負けを逃れるために効果があるピップを多く無駄に使う。青は3回に1回くらいギャモンセーブできそうだから、最善のプレイはギャモン負けしないようにすることだ。青は24/12とするべきだ。1枚残してヒットの可能性を残し、しかしピップを無駄遣いしないでクロスオーバーもしている。<br> <br> kinchan:<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis"> 1. Cubeful 2-ply 14/11 6/3(2) 5/2 Eq.: -1.571 0.088 0.000 0.000 - 0.912 0.693 0.084 2. Cubeful 2-ply 14/8 6/3 5/2 Eq.: -1.574 (-0.003) 0.086 0.000 0.000 - 0.914 0.696 0.079 3. Cubeful 2-ply 14/11 6/3 5/2(2) Eq.: -1.574 (-0.003) 0.087 0.000 0.000 - 0.913 0.696 0.082 4. Cubeful 2-ply 6/3(2) 5/2(2) Eq.: -1.577 (-0.007) 0.089 0.000 0.000 - 0.911 0.699 0.086 <NAME> 2-ply 8/2 6/3 5/2 Eq.: -1.585 (-0.014) 0.085 0.000 0.000 - 0.915 0.698 0.085 </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "BR9"; const probnum = "49"; const showpipflg = false; const board = new BgBoard("#board", "boardStyle1", "cw"); board.showBoard("XGID=----BDE-A-----A-------deB-:1:1:1:33:0:0:0:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: Q/QZ3/39.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>Othello Quiz</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">Problem 9 (2013)</span>&ensp; <span>(QZ3-39)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Black to play 42</div> <div class="gamesituation">b3-w1/5</div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Black=71 White=146</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description"><pre> 1. 22/18* 5/3 eq: +2.332 93.92% (G:86.68% B:11.88%) 6.08% (G: 0.49% B: 0.02%) 2. 22/18* 6/4 eq: +2.251 (-0.081) 92.28% (G:84.98% B:15.92%) 7.72% (G: 0.62% B: 0.03%) 3. 22/18* 3/1 eq: +2.226 (-0.106) 91.21% (G:84.17% B:17.22%) 8.79% (G: 0.26% B: 0.04%) 4. 22/18* 18/16 eq: +2.207 (-0.125) 91.27% (G:83.63% B:15.19%) 8.73% (G: 0.73% B: 0.08%) 5. 5/3 5/1 eq: +2.166 (-0.166) 92.59% (G:78.48% B: 6.66%) 7.41% (G: 0.44% B: 0.02%) </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "QZ3"; const probnum = "39"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle1", "cw"); board.showBoard("XGID=cBDABBC-------a---aecbA---:0:0:1:42:3:1:0:5:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/quizpager.js"></script> </body> </html> ======================= File: C/CBt/10.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>ChrisBray</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">2018 - Position 172</span>&ensp; <span>(CBt-10)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Match Play. Red trails 2-3 to 5. Should Red double? If, doubled, should White take?</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Red=67 White=72</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">My opponent mistakenly took my double in this position in an online match. That was a triple blunder.<br> <br> White’s take point is around 29% at this score and he is nowhere near that. The race is deceptive as red has only nine pips to roll before he starts to bear off while White has 22. Hi hitting chances are minimal and if may be he who has to leave the first shot.<br> <br> White wins only 21.5% of the time from here. He should give this one up and effectively play at DMP.<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis">Cube analysis 2-ply cubeless equity +0.557 (Money: +0.556) 0.776 0.004 0.000 - 0.224 0.000 0.000 Cubeful equities: 1. Double, pass +1.000 2. Double, take +1.215 (+0.215) 3. No double +0.869 (-0.131) Proper cube action: Double, pass </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "CBt"; const probnum = "10"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle2", "ccw"); board.showBoard("XGID=-BBBCBAAb-B---------bcbdb-:0:0:1:00:2:3:0:5:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: C/CB6/22.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>ChrisBray</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">2014 - Position 272</span>&ensp; <span>(CB6-22)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Money Play. How should Red play 21?</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Red=152 White=159</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">Those six checkers on Red's 6-pt look very ugly and plays like bar/23, 24/23 or bar/24, 13/11 or bar/24, 6/4 don't improve matters much.<br> <br> This is a case of putting them where you want them' and the correct play is bar/23, 6/5. This keeps the back checkers diversified and starts the most important point on the board.<br> <br> Any other play is a blunder.<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis"> 1. Cubeful 2-ply 9/4 6/4 Eq.: +0.436 0.593 0.055 0.001 - 0.407 0.062 0.000 2. Cubeful 2-ply 19/17 9/4 Eq.: +0.194 (-0.243) 0.536 0.045 0.001 - 0.464 0.099 0.000 3. Cubeful 2-ply 19/14 6/4 Eq.: +0.193 (-0.243) 0.530 0.042 0.001 - 0.470 0.089 0.000 4. Cubeful 2-ply 19/14 9/7 Eq.: +0.176 (-0.261) 0.517 0.040 0.001 - 0.483 0.068 0.000 5. Cubeful 0-ply 19/17 6/1 Eq.: +0.179 (-0.257) 0.533 0.037 0.000 - 0.467 0.106 0.000 </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "CB6"; const probnum = "22"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle2", "ccw"); board.showBoard("XGID=-a-bC-E----BbC--ad-c--b-AA:fd00:a516:7c1b:17cd:6d81:2137:bd2a:2c5b:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: C/CBq/27.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>ChrisBray</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">2018 - Position 64</span>&ensp; <span>(CBq-27)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Money Game; How should Red play 65?</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Red=124 White=58</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">Hitting with 8/3* is clearly wrong but does Red play 19/14 or 12/7?<br> <br> The former provides outfield coverage while the latter brings another checker to attack the White blot on Red’s 3-pt.<br> <br> Given that White is not favourite to escape next roll, 12/7 is the logical play and in fact bar/19/14 is an error despite the fact that White can play 61, 62, 63 and 64 without leaving a direct if Red plays bar/19, 12/7. Note that bar/19/14 leaves White both 63 and 65 to hit and potentially win a gammon.<br> <br> In fact, bar/19/14 doubles Red gammon losses from 4.2% to 8.4%.<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis"> 1. Cubeful 2-ply bar/19 12/7 Eq.: +0.673 0.697 0.054 0.001 - 0.303 0.047 0.000 2. Cubeful 2-ply bar/14 Eq.: +0.606 (-0.067) 0.678 0.050 0.001 - 0.322 0.092 0.000 3. Cubeful 2-ply bar/19 16/11 Eq.: +0.547 (-0.126) 0.650 0.047 0.001 - 0.350 0.091 0.001 4. Cubeful 0-ply bar/19 6/1 Eq.: +0.369 (-0.304) 0.605 0.049 0.001 - 0.395 0.098 0.000 5. Cubeful 0-ply bar/19 8/3* Eq.: +0.249 (-0.424) 0.611 0.056 0.002 - 0.389 0.234 0.004 </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "CBq"; const probnum = "27"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle2", "ccw"); board.showBoard("XGID=---aBCCBB---A---A---bbbddA:fd00:c2b6:b24b:be67:2827:688d:e6a1:6a3b:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: C/CC3/03.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>ChrisBray</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">2020 - Position 103</span>&ensp; <span>(CC3-03)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Money Play. How should Red play 54?</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Red=105 White=175</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">This is the continuation of Problem 102. Should Red make the 2-pt or run off White’s bar-point?<br> The problem with making the 2-pt is that when White enters with a 4 Red will find it difficult to run home.<br> The priority is getting the checkers home and 18/14, 18/13 is correct. It will win slightly fewer gammons but increases the game winning percentage by 6%. That is a huge margin and 7/2, 6/2 is actually a blunder­­­­.<br> Even at 4-away vs 2-away running off the bar is correct. First win the game and then win the gammon - a useful maxim.<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis"> 1. Cubeful 2-ply 18/14 18/13 Eq.: +0.868 0.778 0.412 0.004 - 0.222 0.028 0.000 2. Cubeful 2-ply 7/2 6/2 Eq.: +0.809 (-0.059) 0.742 0.451 0.003 - 0.258 0.039 0.001 3. Cubeful 2-ply 18/13 14/10 Eq.: +0.757 (-0.112) 0.738 0.403 0.005 - 0.262 0.037 0.001 4. Cubeful 2-ply 18/9 Eq.: +0.718 (-0.150) 0.722 0.405 0.006 - 0.278 0.041 0.002 5. Cubeful 0-ply 18/14 7/2 Eq.: +0.611 (-0.257) 0.695 0.380 0.004 - 0.305 0.058 0.002 </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "CC3"; const probnum = "03"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle2", "ccw"); board.showBoard("XGID=aB-BbCCB----d-A--dBd------:1:-fd00:c2b6:b24b:be67:2827:688d:e6a1:6a3b"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: C/CBh/15.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>ChrisBray</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">2016 - Position 213</span>&ensp; <span>(CBh-15)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Money Play. How should Red play 43?</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Red=95 White=111</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">My rule of thumb is that I rarely leave a voluntary shot against a four-point board and this position is no exception. White may well have to weaken his position next turn so now is precisely not the time to leave a shot voluntarily<br> <br> 6/3, 6/2 is right by a long way!<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis"> 1. Cubeful 2-ply 6/3 6/2 Eq.: +0.211 0.661 0.035 0.000 - 0.339 0.030 0.000 2. Cubeful 2-ply 14/11 14/10 Eq.: +0.188 (-0.023) 0.646 0.093 0.003 - 0.354 0.077 0.002 3. Cubeful 2-ply 14/7 Eq.: +0.135 (-0.076) 0.627 0.061 0.001 - 0.373 0.040 0.000 4. Cubeful 2-ply 8/1 Eq.: +0.130 (-0.080) 0.622 0.081 0.001 - 0.378 0.067 0.001 5. Cubeful 2-ply 7/3 5/2 Eq.: +0.006 (-0.205) 0.579 0.076 0.001 - 0.421 0.080 0.001 </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "CBh"; const probnum = "15"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle2", "ccw"); board.showBoard("XGID=--BBbCBBB---b-B----cabbc--:1:-1:1:43:0:0:3:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: C/CBw/42.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>ChrisBray</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">2019 - Position 92</span>&ensp; <span>(CBw-42)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Money Play. How should Red play 33?</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Red=95 White=194</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">At a point in time assets become liabilities and when playing against a back game it is crucial to know when to dismantle assets (points).<br> <br> That is very much the case here. Over the board Red woodenly played 10/7(2), 10/4 but that move is a 2.5 blunder. The correct play is 10/7, 6/3(3)*, dismantling the most difficult home board point, and hopefully giving time to Red to bear in the rest of his checkers. <br> <br> After that play Red is still not the favourite to win the game although he will come out ahead on equity due the percentage of gammons he wins.<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis"> 1. Cubeful 2-ply 10/7 6/3*(3) Eq.: +0.307 0.517 0.340 0.011 - 0.483 0.083 0.001 2. Cubeful 2-ply 7/4 6/3*(3) Eq.: +0.304 (-0.003) 0.515 0.341 0.011 - 0.485 0.085 0.001 3. Cubeful 2-ply 10/4 7/4 6/3* Eq.: +0.276 (-0.031) 0.497 0.322 0.017 - 0.503 0.101 0.002 4. Cubeful 2-ply 10/7(3) 6/3* Eq.: +0.237 (-0.070) 0.494 0.315 0.014 - 0.506 0.104 0.002 5. Cubeful 2-ply 10/4 10/7(2) Eq.: +0.169 (-0.138) 0.479 0.315 0.013 - 0.521 0.099 0.001 </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "CBw"; const probnum = "42"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle2", "ccw"); board.showBoard("XGID=-BcaBbCCB-C---a--bbbb-----:fdf8:f53e:61e4::18:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: C/CB5/45.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>ChrisBray</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">2014 - Position 245</span>&ensp; <span>(CB5-45)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Money Play. How should Red play 51?</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Red=141 White=122</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">I used to play these positions passively and hope my opponent would roll an awkward number and so I would play 11/5.<br> <br> Over time I have come to understand that the strategy for playing against one rear checker, i.e. attack, is still correct in such positions. 7/6, 7/2* is the move here with 11/10, 7/2* a close second. 11/5 is a blunder above the 0.1 level. Notice that after the hit 21 and 24 aren't that great for White.<br> <br> The hit is particularly correct because of White's exposed blot on his 1-pt. Give him his 1-pt by moving the spare checker from his 3-pt and then 11/5 and 7/6, 7/2* are just about equal. As ever, the detail matters.<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis"> 1. Cubeful 2-ply 13/8 11/5 Eq.: +0.137 0.526 0.180 0.010 - 0.474 0.159 0.012 2. Cubeful 2-ply 11/6 11/5 Eq.: +0.093 (-0.044) 0.514 0.179 0.009 - 0.486 0.157 0.011 3. Cubeful 2-ply 13/7 11/6 Eq.: +0.051 (-0.086) 0.511 0.170 0.010 - 0.489 0.168 0.013 4. Cubeful 2-ply 13/8 13/7 Eq.: -0.010 (-0.147) 0.501 0.157 0.009 - 0.499 0.175 0.014 5. Cubeful 2-ply 13/2 Eq.: -0.057 (-0.194) 0.487 0.163 0.009 - 0.513 0.181 0.014 </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "CB5"; const probnum = "45"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle2", "ccw"); board.showBoard("XGID=--aBBBBB---Ab-b--bBbbcB-a-:1:-1:1:51:0:0:3:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: K/KE9/36.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>keeae</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">ターゲットはこいつ</span>&ensp; <span>(KE9-36)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction"></div> <div class="gamesituation">b0-w0/7</div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips b=125 w=193</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">一見たくさん捕まえているがノーボード。簡単に生き返れる状態でアタックしても相手は動かすチェッカーに困らないし、バックゲームに持ち込まれるとタイミングが合ってしまう。ここは4ポイントに作られたアンカーを穴あきプライムに閉じ込めることを狙って9ポイントをカバーしながらエスケープする。3ポイントのブロットはプライムに参加していないし進みすぎたこちらにとってそれほど守る必要もない。<br> <br> 1. 21/15 10/9 Eq.: +0.057<br> 0.555 0.211 0.009 - 0.445 0.103 0.004 CL +0.232 CF +0.057<br> <br> 2. 8/2* 3/2 Eq.: -0.079 ( -0.136)<br> 0.494 0.240 0.014 - 0.506 0.114 0.004 CL +0.137 CF -0.079<br> <br> 3. 10/9 8/2* Eq.: -0.080 ( -0.137)<br> 0.512 0.204 0.010 - 0.488 0.126 0.006 CL +0.113 CF -0.080<br> <br> 4. 9/3 6/5 Eq.: -0.098 ( -0.155)<br> 0.501 0.204 0.010 - 0.499 0.115 0.005 CL +0.104 CF -0.098<br> <br> 5. 8/2*/1* Eq.: -0.113 ( -0.170)<br> 0.496 0.211 0.007 - 0.504 0.128 0.007 CL +0.086 CF -0.113<br> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "KE9"; const probnum = "36"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle1", "cw"); board.showBoard("XGID=-aaAc-E-DAC-c----b-cbA----:1:-1:1:16:0:0:0:7:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/keeaepager.js"></script> </body> </html> ======================= File: G/GP9/15.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>GPS</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">第33回(gps) - 問7</span>&ensp; <span>(GP9-15)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">黒の手番です。43 はどう動かしますか?</div> <div class="gamesituation">Unlimited</div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Black=71 White=114</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description"><pre> 1. 7/4 7/3 eq:+0.223 52.45% (G:4.83% B:0.10%) 47.55% (G:7.90% B:0.33%) 2. 8/5 8/4 eq:+0.174 (-0.049) 51.78% (G:4.43% B:0.09%) 48.22% (G:8.61% B:0.39%) 3. 8/1 eq:+0.010 (-0.213) 44.36% (G:3.07% B:0.03%) 55.64% (G:7.17% B:0.20%) 4. 6/3 5/1 eq:-0.192 (-0.414) 40.83% (G:2.47% B:0.03%) 59.17% (G:9.08% B:0.25%) 5. 8/4 7/4 eq:-0.241 (-0.464) 41.85% (G:3.97% B:0.05%) 58.15% (G:9.39% B:0.27%) </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "GP9"; const probnum = "15"; const showpipflg = false; const board = new BgBoard("#board", "boardStyle6", "cw"); board.showBoard("XGID=-CbB-DBBB--------bbbbbba--:0:0:1:43:0:0:3:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/quizpager.js"></script> </body> </html> ======================= File: G/GP9/42.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>GPS</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">第39回(gps) - 問4</span>&ensp; <span>(GP9-42)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">黒の手番です。32 はどう動かしますか?</div> <div class="gamesituation">Unlimited</div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Black=131 White=66</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description"><pre> 1. 21/19* 4/1 eq:-0.728 19.37% (G:1.12% B:0.01%) 80.63% (G:19.36% B:0.18%) 2. 22/19* 4/2 eq:-0.853 (-0.125) 15.54% (G:0.69% B:0.01%) 84.46% (G:22.34% B:0.21%) 3. 21/18 21/19* eq:-0.879 (-0.151) 18.81% (G:1.54% B:0.02%) 81.19% (G:32.86% B:1.03%) 4. 22/19* 21/19 eq:-0.890 (-0.162) 16.35% (G:0.94% B:0.01%) 83.65% (G:28.22% B:0.30%) 5. 21/18 4/2 eq:-0.888 (-0.160) 16.63% (G:0.87% B:0.01%) 83.37% (G:28.62% B:0.20%) </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "GP9"; const probnum = "42"; const showpipflg = false; const board = new BgBoard("#board", "boardStyle6", "cw"); board.showBoard("XGID=-DC-AB----------bb-acCBdc-:1:1:1:32:0:0:3:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/quizpager.js"></script> </body> </html> ======================= File: K/KEb/34.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>keeae</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">打ち返される場所</span>&ensp; <span>(KEb-34)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction"></div> <div class="gamesituation">b1-w2/7</div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips b=135 w=166</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">1の目でヒットは確定、バーポイントを取られないようにヒットするがそのまま置いておくとリターンヒットされたときに取り返される危険がある。どうしてもこちらがバーポイントを作りたいのであれば置いておきたいが相手のアウターから向こう側のチェッカーが前のめりになっていてリターンヒットできなければかなり厳しいムーブを強制される。ここは相手の唯一の希望となっているバーポイントへのリターンヒットをさせないためにもひき逃げがベストになっている。<br> <br> 1. 8/7*/5 Eq.: +0.941<br> 0.660 0.288 0.020 - 0.340 0.078 0.003 CL +0.577 CF +0.941<br> <br> 2. 15/13 8/7* Eq.: +0.825 (-0.116)<br> 0.652 0.266 0.018 - 0.348 0.088 0.004 CL +0.522 CF +0.825<br> <br> 3. 13/11 8/7* Eq.: +0.779 (-0.162)<br> 0.651 0.275 0.020 - 0.349 0.103 0.008 CL +0.516 CF +0.779<br> <br> 4. 23/21 8/7* Eq.: +0.772 (-0.169)<br> 0.648 0.269 0.018 - 0.352 0.098 0.006 CL +0.508 CF +0.772<br> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "KEb"; const probnum = "34"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle1", "cw"); board.showBoard("XGID=-a-bCBBaC---bC-A-b-cd--A--:0:0:1:12:1:2:0:7:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/keeaepager.js"></script> </body> </html> ======================= File: Z/ZM3/13.html ======================= <reponame>hinacoppy/problemPager<filename>Z/ZM3/13.html <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>BG Quiz</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">Money Move: Position 577</span>&ensp; <span>(ZM3-13)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">White to play 32</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips White=161 Black=161</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description"><pre> 1. 24/22 23/20 eq: -0.256 44.70% (G:10.86% B:0.51%) 55.30% (G:17.72% B:0.63%) 2. 13/8 eq: -0.259 (-0.004) 44.31% (G:11.47% B:0.50%) 55.69% (G:17.42% B:0.67%) 3. 23/20 13/11 eq: -0.263 (-0.007) 44.33% (G:12.01% B:0.65%) 55.67% (G:18.07% B:0.90%) 4. 24/22 13/10 eq: -0.274 (-0.018) 43.87% (G:11.43% B:0.54%) 56.13% (G:17.82% B:0.85%) 5. 13/11 13/10 eq: -0.286 (-0.031) 43.51% (G:12.39% B:0.62%) 56.49% (G:18.67% B:1.07%) 6. 23/18 eq: -0.289 (-0.033) 44.07% (G:10.77% B:0.54%) 55.93% (G:19.01% B:0.70%) 7. 13/11 8/5 eq: -0.304 (-0.048) 43.71% (G:12.25% B:0.60%) 56.29% (G:19.99% B:1.32%) </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "ZM3"; const probnum = "13"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle4", "cw"); board.showBoard("XGID=-b----E-D---eD---b-d-b-AA-:0:0:1:32:0:0:3:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/quizpager.js"></script> </body> </html> ======================= File: Z/ZM7/23.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>BG Quiz</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">Money Move: Position 505</span>&ensp; <span>(ZM7-23)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">White to play 55</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips White=164 Black=74</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description"><pre> 1. 16/11(2) 13/8 9/4 eq: -1.007 8.51% (G: 0.35% B:0.00%) 91.49% (G:21.04% B:0.05%) 2. 16/11 16/6 9/4 eq: -1.010 (-0.003) 8.30% (G: 0.34% B:0.00%) 91.70% (G:20.85% B:0.05%) 3. 16/11 16/6 13/8 eq: -1.011 (-0.003) 8.05% (G: 0.33% B:0.00%) 91.95% (G:20.26% B:0.05%) 4. 16/11(2) 13/8(2) eq: -1.014 (-0.007) 8.24% (G: 0.33% B:0.00%) 91.76% (G:21.06% B:0.05%) 5. 16/6(2) eq: -1.015 (-0.008) 7.79% (G: 0.32% B:0.01%) 92.21% (G:20.14% B:0.05%) </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "ZM7"; const probnum = "23"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle4", "cw"); board.showBoard("XGID=----A-C-CB---B--BbbcdB-bb-:1:1:1:55:11:18:3:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/quizpager.js"></script> </body> </html> ======================= File: K/KA6/05.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>michy problem</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">テイクかパスか?</span>&ensp; <span>(KA6-05)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">白の振り番で、ダブルすることは明らかだろう。で、テイクかパスか?</div> <div class="gamesituation">5ポイントマッチ、白が2-1でリード。</div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips 緑=149 白=126</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">・相手はまだ2pointed board。それに対してこちらは4pointed board<br> ・相手のprime potencialは低い<br> 以上から実戦ではtakeと判断した。<br> しかし0.300のエラー!<br> <br> 手振りrolloutをして分かったこと。<br> 黒にはヒットチャンスがけっこうやって来る。<br> しかしそれが当たっても、まだまだ勝ちには遠い。<br> つまり、ヒットして即優勢になるようなboardを持っていればtakeでよいが、そうでないならばpassするべきだ。<br> <br> nori><br> 18ptにいるコマを23ptにするとtakeになったりしませんか?<br> 2 men on the barのシーケンスが多すぎる気がします。<br> <br> michihito_k><br> 18ポイントの駒が23ポイントに移動したとすると、あまりにもポジションが変わり過ぎて、比較にならないと思いますわ。<br> <br> 面白いのは緑のインナーを変えた場合。<br> エースポイントの2枚を2ポイントに移すだけでかなり強くなり、テイクになるんです!<br> <br> michihito_k><br> noriさんのアイディア通り、18ポイントのバックマンを23ポイントに移してみた。<br> するとパスという結果は変わらないが、0.75のエラーで済む。<br> <br> ちなみにオリジナルポジションのmoney cubeless equityは0.660。<br> それがバックマンを移動することで0.594になっている。<br> <br> michihito_k><br> あう、上記の0.75は間違いで、当然0.075が正です。<br> <br> nori><br> primeで反撃できるとかなり違うのですね。<br> primeの価値は0.3以上だけど、backmanの位置は0.2前後ということで。<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis">Cube analysis 2-ply cubeless equity -0.408 (Money: -0.300) 0.379 0.110 0.002 - 0.621 0.160 0.010 Cubeful equities: 1. No double -0.391 2. Double, pass +1.000 (+1.391) 3. Double, take -1.051 (-0.661) Proper cube action: No double, take (32.2%) </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "KA6"; const probnum = "05"; const showpipflg = false; const board = new BgBoard("#board", "boardStyle5", "ccw"); board.showBoard("XGID=-B-B-BBa----bDb--cAe--b-AA:0:0:1:00:1:2:0:5:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: B/BR3/41.html ======================= <reponame>hinacoppy/problemPager <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>501</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">7. ゲーム中盤</span>&ensp; <span>(BR3-41)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">No.138 Blue to play 34</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips b=145 w=132</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">501:後ろのチェッカーを必要がないのに動かしてはならない。実戦では青は白のために24ポイントのチェッカーを残して18/11とプレイした。よりよいプレイは9/5, 8/5で、5ポイントを作るだけでなく18ポイントに残ってアンカーを作ろうとしている。もし白がヒットしてきたら、同時にインナーポイントはできないし、青は多くのリターンショットを得る。<br> <br> kinchan:<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis"> 1. Cubeful 2-ply 9/5 8/5 Eq.: -0.535 0.342 0.061 0.002 - 0.658 0.095 0.003 2. Cubeful 2-ply 18/11 Eq.: -0.563 (-0.028) 0.335 0.041 0.001 - 0.665 0.079 0.002 3. Cubeful 2-ply 13/10 9/5 Eq.: -0.586 (-0.051) 0.333 0.056 0.002 - 0.667 0.109 0.004 4. Cubeful 2-ply 8/5 8/4 Eq.: -0.609 (-0.074) 0.329 0.054 0.002 - 0.671 0.116 0.004 5. Cubeful 2-ply 18/15 9/5 Eq.: -0.613 (-0.078) 0.325 0.049 0.002 - 0.675 0.098 0.003 </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "BR3"; const probnum = "41"; const showpipflg = false; const board = new BgBoard("#board", "boardStyle1", "cw"); board.showBoard("XGID=---B--D-BB--dC--bdAe----A-:0:0:1:34:0:0:0:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: C/CB6/01.html ======================= <gh_stars>0 <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>ChrisBray</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">2014 - Position 251</span>&ensp; <span>(CB6-01)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Money Play. How should Red play 43?</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Red=97 White=70</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">Should Red play the trap play 8/5, 8/5 so that White has to play his sixes? Experience tells us that such plays should be executed when your opponent has only a two-point home board. <br> <br> That would imply it is too risky here and that is correct. Red needs to position his checkers to catch any fleeing White checker and he would also like to make his 4-pt. It is a choice between 17/10, and 17/13, 14/11. These plays have identical equity and are both better than 14/7 which reduces outer board coverage.<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis"> 1. Cubeful 2-ply 17/10 Eq.: +0.752 0.838 0.138 0.002 - 0.162 0.009 0.000 2. Cubeful 2-ply 17/13 14/11 Eq.: +0.745 (-0.007) 0.837 0.132 0.002 - 0.163 0.007 0.000 3. Cubeful 2-ply 14/7 Eq.: +0.737 (-0.015) 0.835 0.129 0.002 - 0.165 0.007 0.000 4. Cubeful 2-ply 14/10 6/3 Eq.: +0.709 (-0.043) 0.823 0.132 0.002 - 0.177 0.009 0.000 5. Cubeful 2-ply 17/13 6/3 Eq.: +0.708 (-0.044) 0.824 0.126 0.002 - 0.176 0.007 0.000 </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "CB6"; const probnum = "01"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle2", "ccw"); board.showBoard("XGID=-BbB-BCBB-----A--A----dcf-:1:-1:1:43:0:0:3:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: Z/ZS1/25.html ======================= <gh_stars>0 <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>BG Quiz</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">Backgammon Strategy: Position 83</span>&ensp; <span>(ZS1-25)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">White to play 11</div> <div class="gamesituation">w5-b8/9</div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips White=94 Black=93</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description"><pre> 1. 13/12 6/5(2) 3/2 eq: +0.295 63.34% (G: 2.79% B:0.06%) 36.66% (G: 3.23% B:0.05%) 2. 8/5 6/5 eq: +0.281 (-0.014) 62.31% (G: 3.41% B:0.10%) 37.69% (G: 3.44% B:0.06%) 3. 13/11 6/5(2) eq: +0.273 (-0.023) 62.01% (G: 3.17% B:0.08%) 37.99% (G: 4.47% B:0.06%) 4. 6/5(2) 2/1(2) eq: +0.258 (-0.038) 61.20% (G: 3.27% B:0.07%) 38.80% (G: 3.83% B:0.05%) 5. 10/9(2) 6/5(2) eq: +0.250 (-0.045) 60.85% (G: 3.26% B:0.08%) 39.15% (G: 3.85% B:0.00%) 6. 6/5(2) 3/1 eq: +0.247 (-0.048) 60.60% (G: 3.41% B:0.09%) 39.40% (G: 4.24% B:0.07%) 7. 13/12 6/5(2) 2/1 eq: +0.240 (-0.056) 60.00% (G: 3.87% B:0.10%) 40.00% (G: 5.85% B:0.11%) </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "ZS1"; const probnum = "25"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle4", "cw"); board.showBoard("XGID=--BCb-D-C-B--A-----cbcbba-:0:0:1:11:5:8:1:9:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/quizpager.js"></script> </body> </html> ======================= File: C/CB2/33.html ======================= <reponame>hinacoppy/problemPager <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>ChrisBray</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">2014 - Position 83</span>&ensp; <span>(CB2-33)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Match Play – Double Match Point. How should Red play 42?</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Red=118 White=199</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">The correct play is the same at DMP as for money – essentially because the approach doesn't change.<br> <br> If White enters on Red's 2-pt Red will hit to make sure White doesn't get a well-timed back game. So Red needs to bring builders in range of the 2-pt. He also wants to think about dismantling his mid-point as looking ahead that will be the most difficult point to clear. The checker on White's 5-pt is in no danger and can be cleared later.<br> <br> The obvious plays are 13/9, 8/6 and 13/11, 13/9. There is no real need to give White a great double four and the 8-pt may yet prove useful. Therefore the correct play is 13/11, 13/9. All other plays are at least errors.<br> <br> I was White in this position. My opponent woodenly played 20/14 and later lost the game when he couldn't clear his mid-point safely.<br> </div> </div> <hr> <pre id="gnuanalysis" class="gnuanalysis">Cube analysis 2-ply cubeless equity +1.051 (Money: +0.962) 0.747 0.526 0.006 - 0.253 0.062 0.003 Cubeful equities: 1. No double +1.041 2. Double, take +1.498 (+0.458) 3. Double, pass +1.000 (-0.041) Proper cube action: Too good to double, pass (8.1%) </pre> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "CB2"; const probnum = "33"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle2", "ccw"); board.showBoard("XGID=bB-BbBBbB---cD-----dAb----:1:-1:1:42:5:6:0:7:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/problempager.js"></script> </body> </html> ======================= File: Q/QZa/07.html ======================= <gh_stars>0 <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>Peever Quiz</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">Position 7 (Peever Quiz 2005)</span>&ensp; <span>(QZa-07)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Black to Play 65</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Black=157 White=139</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">スプリット(24/18, 13/8)は24通りものショットを残しますが、それにも関わらずスプリットが正解です。プレイの後に7ピップ遅れているので黒は走る手に代わる手を考慮すべきです。<br> 黒はこの大胆なスプリットをするのに十分な代償を受け取ることができます。<br> • 8ポイントを作り直す。<br> • 18ポイントにアンカーを作れるかもしれない。<br> • リターンショット(少なくとも6通り)のチャンスがある。<br> • もしヒットされてエースポイントをつくったら、7ピップのロスがプライム戦で有利にはたらく。<br> <br> Splitting (24/18 13/8) is correct, even though it leaves 24 shots on the 18pt. Trailing by 7 pips after the play, Black should consider alternatives to running.<br> Black receives adequate compensation for making this daring split:<br> • He remakes his 8pt.<br> • He may anchor on the 18pt.<br> • He usually has a chance to hit a return shot (at least 6 numbers).<br> • If he is hit and remakes the 24pt, the 7 pips he loses helps in the prime-vs-prime contest.<br> <br> <pre> 1. 24/18 13/8 Eq.: -0.382 0.9% 12.8% 44.2% 55.8% 28.5% 1.2% 2. 13/7 13/8 Eq.: -0.400 (-0.018) 0.7% 12.6% 41.8% 58.2% 23.7% 2.6% 3. 24/13 Eq.: -0.401 (-0.019) 0.6% 11.1% 41.9% 58.1% 24.9% 0.9% </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "QZa"; const probnum = "07"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle1", "cw"); board.showBoard("XGID=-b--BBC-A---cE---b-bbbb-B-:0:0:1:56:0:0:1:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/quizpager.js"></script> </body> </html> ======================= File: Z/ZMb/32.html ======================= <reponame>hinacoppy/problemPager <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>BG Quiz</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">Money Move: Position 619</span>&ensp; <span>(ZMb-32)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">White to play 21</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips White=142 Black=144</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description"><pre> 1. 24/23 6/4 eq: -0.231 44.17% (G: 6.73% B:0.25%) 55.83% (G:12.65% B:0.22%) 2. 24/23 8/6 eq: -0.334 (-0.103) 41.82% (G: 6.42% B:0.20%) 58.18% (G:14.84% B:0.29%) 3. 6/5 6/4 eq: -0.375 (-0.144) 39.93% (G: 7.19% B:0.29%) 60.07% (G:14.45% B:0.32%) 4. 6/3 eq: -0.427 (-0.196) 38.94% (G: 6.76% B:0.27%) 61.06% (G:15.88% B:0.30%) 5. 8/5 eq: -0.374 (-0.143) 39.76% (G: 6.95% B:0.24%) 60.24% (G:14.50% B:0.46%) 6. 10/9 10/8 eq: -0.421 (-0.190) 38.43% (G: 5.82% B:0.12%) 61.57% (G:14.34% B:0.34%) 7. 24/23 10/8 eq: -0.449 (-0.218) 38.46% (G: 5.99% B:0.16%) 61.54% (G:17.46% B:0.55%) </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "ZMb"; const probnum = "32"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle4", "cw"); board.showBoard("XGID=------EcCBB-cBa---bb-bb-A-:0:0:1:21:0:0:3:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/quizpager.js"></script> </body> </html> ======================= File: K/KE1/38.html ======================= <reponame>hinacoppy/problemPager <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>keeae</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">エンターされても困らないポイント</span>&ensp; <span>(KE1-38)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction"></div> <div class="gamesituation">b3-w2/7</div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips b=100 w=54</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description">3を振ったので思わず1ポイントをカバーしてしまった。セミプラを持っているためエッジに寄らないエンターはたいして痛くない。ここは2を振られた時のためにアウターを支配すべくバックマンを持ってきておくべきだった。<br> <br> 1. 20/14 19/13 Eq.: +0.751<br> 0.864 0.069 0.001 - 0.136 0.017 0.000 CL +0.816 CF +0.751<br> <br> 2. 20/8 Eq.: +0.750 ( -0.002)<br> 0.862 0.074 0.001 - 0.138 0.019 0.000 CL +0.816 CF +0.750<br> <br> 3. 20/11 19/16 Eq.: +0.698 ( -0.053)<br> 0.846 0.065 0.001 - 0.154 0.018 0.000 CL +0.771 CF +0.698<br> <br> 4. 20/17 19/10 Eq.: +0.694 ( -0.057)<br> 0.843 0.067 0.001 - 0.157 0.015 0.000 CL +0.772 CF +0.694<br> <br> 5. 20/14 19/16 6/3 Eq.: +0.673 ( -0.078)<br> 0.837 0.067 0.001 - 0.163 0.021 0.000 CL +0.749 CF +0.673<br> <br> 6. 19/7 Eq.: +0.670 ( -0.081)<br> 0.835 0.067 0.001 - 0.165 0.012 0.000 CL +0.759 CF +0.670<br> <br> 7. 20/11 6/3 Eq.: +0.667 ( -0.084)<br> 0.836 0.064 0.001 - 0.164 0.019 0.000 CL +0.748 CF +0.667<br> <br> 8. 19/10 6/3 Eq.: +0.660 ( -0.091)<br> 0.831 0.067 0.001 - 0.169 0.018 0.000 CL +0.744 CF +0.660<br> <br> 9. 20/14 19/16 4/1 Eq.: +0.655 ( -0.096)<br> 0.849 0.035 0.000 - 0.151 0.011 0.000 CL +0.738 CF +0.655<br> <br> 10. 20/17 19/13 6/3 Eq.: +0.647 ( -0.104)<br> 0.828 0.065 0.001 - 0.172 0.020 0.000 CL +0.733 CF +0.647<br> <br> 11. 19/10 4/1 Eq.: +0.640 ( -0.111)<br> 0.844 0.033 0.000 - 0.156 0.010 0.000 CL +0.725 CF +0.640<br> <br> 12. 20/11 4/1 Eq.: +0.632 ( -0.119)<br> 0.839 0.032 0.000 - 0.161 0.009 0.000 CL +0.718 CF +0.632<br> <br> 13. 20/17 19/13 4/1 Eq.: +0.626 ( -0.125)<br> 0.838 0.033 0.000 - 0.162 0.009 0.000 CL +0.716 CF +0.626<br> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "KE1"; const probnum = "38"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle1", "cw"); board.showBoard("XGID=aA-BCBCB-----------AAadde-:1:-1:1:33:3:2:0:7:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/keeaepager.js"></script> </body> </html> ======================= File: Q/QZ4/17.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>Othello Quiz</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">Problem 7 (2016)</span>&ensp; <span>(QZ4-17)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Black to play 41</div> <div class="gamesituation">Unlimited Game</div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Black=113 White=94</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description"><pre> 1. 13/8 eq: -0.590 34.86% (G: 4.22% B:0.09%) 65.14% (G:15.94% B:0.74%) 2. 13/9 12/11 eq: -0.672 (-0.082) 32.19% (G: 3.84% B:0.07%) 67.81% (G:12.96% B:0.51%) 3. 13/9 4/3 eq: -0.691 (-0.101) 32.11% (G: 3.71% B:0.07%) 67.89% (G:13.48% B:0.54%) 4. 12/8 4/3 eq: -0.742 (-0.152) 33.19% (G: 4.05% B:0.08%) 66.81% (G:19.01% B:0.98%) 5. 12/7 eq: -0.758 (-0.169) 32.53% (G: 3.66% B:0.07%) 67.47% (G:17.26% B:0.81%) 6. 13/12 6/2* eq: -0.833 (-0.244) 33.24% (G: 4.61% B:0.08%) 66.76% (G:23.35% B:1.49%) 7. 13/9 3/2* eq: -0.859 (-0.269) 35.19% (G: 4.94% B:0.07%) 64.81% (G:29.32% B:2.41%) 8. 12/8 3/2* eq: -0.969 (-0.380) 33.50% (G: 4.57% B:0.07%) 66.50% (G:29.96% B:2.61%) 9. 6/5 6/2* eq: -1.000 (-0.410) 28.94% (G: 3.07% B:0.04%) 71.06% (G:22.53% B:1.35%) </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "QZ4"; const probnum = "17"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle1", "cw"); board.showBoard("XGID=-BaBCBB-----AA---c-bdbbBa-:0:0:1:41:0:0:3:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/quizpager.js"></script> </body> </html> ======================= File: Z/ZP1/36.html ======================= <filename>Z/ZP1/36.html <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>BG Quiz</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">Problem of Week: Position 313</span>&ensp; <span>(ZP1-36)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">White to play 41</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips White=103 Black=130</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description"><pre> 1. 24/23 6/2 eq: +0.533 55.47% (G:38.68% B:0.59%) 44.53% (G:14.83% B:0.81%) 2. 13/12* 6/2 eq: +0.367 (-0.167) 50.08% (G:34.20% B:0.69%) 49.92% (G:13.87% B:1.16%) 3. 8/4 2/1 eq: +0.137 (-0.397) 41.17% (G:26.29% B:0.30%) 58.83% (G: 9.53% B:0.27%) 4. 13/9 2/1 eq: +0.039 (-0.494) 39.00% (G:25.81% B:0.40%) 61.00% (G:13.05% B:1.01%) 5. 24/23 8/4 eq: -0.023 (-0.556) 40.37% (G:25.16% B:0.54%) 59.63% (G:21.60% B:1.33%) 6. 6/1 eq: -0.078 (-0.611) 36.72% (G:24.86% B:0.36%) 63.28% (G:18.18% B:1.19%) 7. 13/12* 12/8 eq: -0.126 (-0.659) 36.90% (G:22.57% B:0.54%) 63.10% (G:20.76% B:1.76%) </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "ZP1"; const probnum = "36"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle4", "cw"); board.showBoard("XGID=aAABBBCbA---aB----bcbbb-A-:fc00:db20:35b:7399::5:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/quizpager.js"></script> </body> </html> ======================= File: Q/QZa/14.html ======================= <filename>Q/QZa/14.html <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>Peever Quiz</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">Position 2 (Peever Back Game Quiz 2013)</span>&ensp; <span>(QZa-14)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">Black to Play 45</div> <div class="gamesituation">Unlimited Game</div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips Black=122 White=204</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description"><pre> 1. 18/13* 5/1 eq: +0.222 56.26% (G:33.91% B:3.01%) 43.74% (G:6.43% B:0.33%) 2. 18/13* 15/11 eq: +0.160 (-0.062) 53.02% (G:34.66% B:2.75%) 46.98% (G:5.46% B:0.22%) 3. 18/13* 13/9 eq: +0.159 (-0.063) 53.07% (G:34.48% B:2.75%) 46.93% (G:5.03% B:0.20%) 4. 18/14 11/6 eq: +0.153 (-0.069) 53.92% (G:31.24% B:2.13%) 46.08% (G:5.14% B:0.20%) 5. 18/13* 9/5 eq: +0.149 (-0.074) 52.69% (G:34.34% B:2.84%) 47.31% (G:5.68% B:0.18%) 6. 18/13* 11/7 eq: +0.143 (-0.079) 53.15% (G:34.54% B:2.74%) 46.85% (G:5.83% B:0.24%) 7. 18/9 eq: +0.141 (-0.081) 53.82% (G:30.42% B:1.97%) 46.18% (G:5.10% B:0.22%) 8. 18/14 15/10 eq: +0.139 (-0.083) 53.50% (G:30.70% B:1.94%) 46.50% (G:5.11% B:0.23%) 9. 18/13* 8/4 eq: +0.129 (-0.093) 52.21% (G:34.86% B:2.93%) 47.79% (G:5.64% B:0.42%) 10. 15/6 eq: +0.129 (-0.093) 53.11% (G:31.13% B:2.26%) 46.89% (G:5.47% B:0.21%) </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "QZa"; const probnum = "14"; const showpipflg = true; const board = new BgBoard("#board", "boardStyle1", "cw"); board.showBoard("XGID=a-bbBBBBBB-Aba-AbbAba-----:1:-1:1:45:0:0:3:0:10"); </script> <script src="../../js/examscore.js"></script> <script src="../../js/quizpager.js"></script> </body> </html> ======================= File: Z/ZO4/13.html ======================= <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="../../css/problempager.css"> <link rel="stylesheet" href="/css/bgStaticBoard.css"> <title>BG Quiz</title> </head> <body> <header> <span id="sectionTitle" class="sectionTitle">Opening Replies: Position 90</span>&ensp; <span>(ZO4-13)</span>&ensp; </header> <nav> <button id="selectfirst">&lt;&lt;</button>&ensp; <button id="selectprev">&lt;</button></button>&ensp; <button id="return2menu">Idx</button>&ensp; <button id="selectnext">&gt;</button>&ensp; <button id="selectlast">&gt;&gt;</button>&ensp; <button id="showanswer">Desc</button>&ensp; <button id="resetscr">Rst SCR</button>&ensp; </nav> <article> <div class="doAction">White to play 11</div> <div class="gamesituation"></div> <div class="bgcontainer"> <div><div id="board" class="board"></div> <div class="pipinfo">pips White=167 Black=161</div> <div id="scr">(CorrectAnswer= 0/0, ErrorScore= 0)</div></div> <div class="answertable"></div> <div class="description"><pre> 1. 8/7(2) 6/5(2) eq: +0.233 55.53% (G:16.92% B:0.99%) 44.47% (G:13.19% B:0.69%) 2. 24/20* eq: +0.134 (-0.099) 52.87% (G:15.05% B:0.80%) 47.13% (G:11.63% B:0.48%) 3. 24/22 6/5(2) eq: +0.099 (-0.133) 53.02% (G:13.90% B:0.72%) 46.98% (G:12.87% B:0.43%) 4. 24/23 6/5(3) eq: +0.067 (-0.166) 51.90% (G:14.29% B:0.68%) 48.10% (G:13.29% B:0.53%) 5. 24/23(2) 6/5(2) eq: +0.042 (-0.190) 50.91% (G:14.11% B:0.68%) 49.09% (G:12.69% B:0.46%) </pre> </div> </div> <hr> </article> <script src="/js/jquery-3.6.0.min.js"></script> <script src="/js/BgUtil_class.js"></script> <script src="/js/BgXgid_class.js"></script> <script src="/js/BgChequer_class.js"></script> <script src="/js/BgStaticBoard_class.js"></script> <script> const categoryid = "ZO
71,624
thestackv1_concat_by_repo-long/65536-65536
Repo: 741645596/graph ======================= File: CreateCoreDLL.bat ======================= @echo off @set Define="UNITY_5_3_OR_NEWER;UNITY_2017_1_OR_NEWER;Release;UNITY_2019_2_OR_NEWER" cd %~dp0 @set DllPath=%cd%\UnityDll @set GameSrcPath=%cd%\Assets\Scripts\Graphics @set Output=%cd%\OutDll\Graphics.Dll @set XmlPath=%cd%\OutDll\Graphics.xml rem set path=%GameSrcPath%; rem echo %path% rem pause rem pause call %cd%\Compile.bat pause ======================= File: Assets/Scripts/Graphics/Transform/Quaternion.cs ======================= namespace RayGraphics.Transform { public class Quaternion { } } ======================= File: Assets/Scripts/Graphics/Math/Index3.cs ======================= <filename>Assets/Scripts/Graphics/Math/Index3.cs namespace RayGraphics.Math { [System.Serializable] public struct Index3 { public int p1; public int p2; public int p3; public Index3(int p1, int p2, int p3) { this.p1 = p1; this.p2 = p2; this.p3 = p3; } /// <summary> /// 是否包含 /// </summary> /// <param name="index"></param> /// <returns></returns> public bool CheckContain(int index) { if (this.p1 == index || this.p2 == index || this.p3 == index) return true; else return false; } /// <summary> /// 是否包含 /// </summary> /// <param name="index1"></param> /// <param name="index2"></param> /// <returns></returns> public bool CheckContain(int index1, int index2) { return this.CheckContain(index1) && this.CheckContain(index2) ; } /// <summary> /// 是否包含 /// </summary> /// <param name="v"></param> /// <returns></returns> public bool CheckContain(Index2 v) { return this.CheckContain(v.p1) && this.CheckContain(v.p2); } public static bool operator!=(Index3 v1, Index3 v2) { bool r1 = v1.CheckContain(v2.p1) && v1.CheckContain(v2.p2) && v1.CheckContain(v2.p3); bool r2 = v2.CheckContain(v1.p1) && v2.CheckContain(v1.p2) && v2.CheckContain(v1.p3); if (r1 && r2) return false; else return true; } public static bool operator ==(Index3 v1, Index3 v2) { bool r1 = v1.CheckContain(v2.p1) && v1.CheckContain(v2.p2) && v1.CheckContain(v2.p3); bool r2 = v2.CheckContain(v1.p1) && v2.CheckContain(v1.p2) && v2.CheckContain(v1.p3); return r1 && r2; } public override bool Equals(System.Object obj) { if (obj == null) { return false; } Index3 p = (Index3)obj; if ((System.Object)p == null) { return false; } bool r1 = this.CheckContain(p.p1) && this.CheckContain(p.p2) && this.CheckContain(p.p3); bool r2 = p.CheckContain(this.p1) && p.CheckContain(this.p2) && p.CheckContain(this.p3); return r1 && r2; } public override int GetHashCode() { return base.GetHashCode(); } } } ======================= File: Assets/Scripts/Voxelization/Contour/ContourOptimization.cs ======================= <filename>Assets/Scripts/Voxelization/Contour/ContourOptimization.cs using System.Collections.Generic; using RayGraphics.Math; using RayGraphics.Geometric; namespace RayGraphics.Voxelization { public class ContourOptimization { /// <summary> /// 生成外轮廓多边形 /// </summary> /// <param name="grid"></param> /// <param name="limitDistance"></param> /// <returns></returns> public static ContourUnit GeneralContourUnit(RLEGridMap grid, MapElement me, float limitDistance) { ContourPoly poly = GeneralOutPoly(grid, me, me.GetKeyPoint(), limitDistance, false); ContourUnit unit = new ContourUnit(poly); ; if (me is MapArea) { Float2 keyPoint = Float2.zero; while (poly.FindKeyPoint(grid, ref keyPoint) == true) { ContourPoly poly1 = GeneralOutPoly(grid, me, keyPoint, limitDistance, true); unit.AddBlockPoly(poly1); } } return unit; } /// <summary> /// 生成外轮廓多边形 /// </summary> /// <param name="grid"></param> /// <param name="me"></param> /// <param name="startSearchPoint"></param> /// <param name="limitDistance"></param> /// <param name="isBlockOutPoly">是否为挡格的轮廓多边形,是的时候需要倒序处理</param> /// <returns></returns> private static ContourPoly GeneralOutPoly(RLEGridMap grid, MapElement me, Float2 startSearchPoint, float limitDistance, bool isBlockOutPoly) { ContourPoly poly = new ContourPoly(); List<Double2> points = me.GetContourPoints(grid, startSearchPoint); if (isBlockOutPoly == true) { points.Reverse(); } List<int> listIndex = ConvexPolygon2D.GenerateConvexPolygonIndex(points.ToArray()); List<Double2> polys = new List<Double2>(); for (int i = 0; i < listIndex.Count; i++) { if (i < listIndex.Count - 1) { OptimizationContourConvexLine(listIndex[i], listIndex[i + 1], false, limitDistance, points, ref polys); } else { OptimizationContourConvexLine(listIndex[i], listIndex[0], true, limitDistance, points, ref polys); } } poly.InitData(polys); return poly; } /// <summary> /// 凸边进行轮廓优化 /// </summary> /// <param name="startIndex"></param> /// <param name="endIndex"></param> /// <param name="isEnd"></param> /// <param name="limitDistance"></param> /// <param name="points"></param> /// <param name="polys"></param> private static void OptimizationContourConvexLine(int startIndex, int endIndex, bool isEnd, float limitDistance, List<Double2> points, ref List<Double2> polys) { if (points == null || points.Count == 0) return; if (polys == null) { polys = new List<Double2>(); } int count = points.Count; List<Double2> listTemp = new List<Double2>(); if (startIndex < endIndex) { for (int k = startIndex; k <= endIndex; k++) { listTemp.Add(points[k]); } } else { for (int k = startIndex; k < count; k++) { listTemp.Add(points[k]); } for (int k = 0; k <= endIndex; k++) { listTemp.Add(points[k]); } } List<Double2> list = OptimizationContourNormalLine(listTemp, limitDistance); if (list!= null && list.Count > 0) { if (polys.Count > 0) { if (list[0] == polys[polys.Count - 1]) { list.RemoveAt(0); } } if (isEnd == true) { if (polys.Count > 0) { if (list[list.Count - 1] == polys[0]) { list.RemoveAt(list.Count - 1); } } } polys.AddRange(list); } } /// <summary> /// 优化轮廓线 /// </summary> /// <param name="listContour"></param> /// <param name="limitDistance"></param> /// <returns></returns> private static List<Double2> OptimizationContourNormalLine(List<Double2> listContour, float limitDistance) { if (listContour == null || listContour.Count < 2) return null; else if (listContour.Count == 2) return listContour; else { List<int> listIndex = new List<int>(); OptimizationContour(listContour, 0, listContour.Count - 1, limitDistance, ref listIndex); List<Double2> listResult = new List<Double2>(); foreach (int index in listIndex) { listResult.Add(listContour[index]); } return listResult; } } /// <summary> /// 优化轮廓线 /// https://www.cnblogs.com/Hichy/p/9149055.html 使用Douglas-Peucker 轨迹压缩算法 /// </summary> /// <param name="listContour"></param> /// <returns></returns> private static void OptimizationContour(List<Double2> listContour, int startIndex, int endIndex, float limitDistance, ref List<int> listIndex) { // 首先判断合法性。 if (listContour == null || listContour.Count < 2 || startIndex < 0 || endIndex >= listContour.Count || endIndex <= startIndex) return; if (listIndex == null) { listIndex = new List<int>(); } //建立线段 double maxDistance = 0; int index = 0; LineSegment2D line = new LineSegment2D(listContour[startIndex], listContour[endIndex]); for (int i = startIndex + 1; i < endIndex; i++) { double distance = line.CalcDistance(listContour[i]); if (distance > maxDistance) { maxDistance = distance; index = i; } } if (maxDistance > limitDistance) { // 分成2段处理 OptimizationContour(listContour, startIndex, index, limitDistance, ref listIndex); OptimizationContour(listContour, index, endIndex, limitDistance, ref listIndex); } else { if (listIndex.Contains(startIndex) == false) { listIndex.Add(startIndex); } if (listIndex.Contains(endIndex) == false) { listIndex.Add(endIndex); } } } } } ======================= File: Assets/Scripts/Graphics/HashCode/BlizzardHash.cs ======================= using System; namespace RayGraphics.Math { /// <summary> /// 暴雪 hash 算法one-way hash /// </summary> public class BlizzardHash { /// <summary> /// 表 /// </summary> private uint[] m_CryptTable = new uint[0x500]; /// <summary> /// 生成hash /// </summary> public void PrepareTable() { uint seed = 0x00100001; uint index1 ; uint index2 ; uint i ; for (index1 = 0; index1 < 0x100; index1++) { for (index2 = index1, i = 0; i < 5; i++, index2 += 0x100) { uint temp1, temp2; seed = (seed * 125 + 3) % 0x2AAAAB; temp1 = (seed & 0xFFFF) << 0x10; seed = (seed * 125 + 3) % 0x2AAAAB; temp2 = (seed & 0xFFFF); m_CryptTable[index2] = (temp1 | temp2); } } } /// <summary> /// Blizzard的这个算法是非常高效的,被称为"One-Way Hash" /// A one-way hash is a an algorithm that is constructed in such a way /// that deriving the original string (set of strings, actually) is virtually impossible /// </summary> /// <param name="strValue"></param> /// <param name="dwHashType">hash 类型</param> /// <returns></returns> public uint HashString(string strValue, uint dwHashType) { uint seed1 = 0x7FED7FED; uint seed2 = 0xEEEEEEEE; uint ch; foreach (char c in strValue) { ch = c; // 因为是作为文件系统使用,所以才用字符串大小不敏感。 if (ch >= 'a' && ch <= 'z') { ch = ch + 'A' - 'a'; } seed1 = m_CryptTable[(dwHashType << 8) + ch] ^ (seed1 + seed2); seed2 = ch + seed1 + seed2 + (seed2 << 5) + 3; } return seed1; } /// <summary> /// 查找hash所在的位置 /// </summary> /// <param name="strValue"></param> /// <param name="lpTable"></param> /// <param name="nTableSize"></param> /// <returns></returns> public int GetHashTablePos(string strValue, SomeHash[] lpTable, int nTableSize) { uint hashOffset = 0; uint hashA = 1; uint hashB = 2; //计算出字符串的三个哈希值(一个用来确定位置,另外两个用来校验) uint nHash = HashString(strValue, hashOffset); uint nHashA = HashString(strValue, hashA); uint nHashB = HashString(strValue, hashB); int nHashStart = (int)(nHash % nTableSize); int nHashPos = nHashStart; while (lpTable[nHashPos].bExists) { // 检查2个hash值是否匹对。 if (lpTable[nHashPos].nHashA == nHashA && lpTable[nHashPos].nHashB == nHashB) { return nHashPos; } else // 找到下一个位置。 { nHashPos = (nHashPos + 1) % nTableSize; } if (nHashPos == nHashStart) break; } return -1; } } /// <summary> /// 相同的hash /// </summary> public struct SomeHash { public int nHashA; public int nHashB; public bool bExists; }; } ======================= File: Assets/Scripts/Graphics/Geometric/Set/Polygon2DSetCross.cs ======================= <reponame>741645596/graph using System.Collections; using System.Collections.Generic; public class Polygon2DSetCross { } ======================= File: Assets/Scripts/Graphics/bounding/AABB.cs ======================= using System.Collections.Generic; using RayGraphics.Math; namespace RayGraphics.Bounding { /// <summary> /// AABB包围盒(Axis-aligned bounding box) /// </summary> public class AABB : IBounding { private Float3 _min = Float3.zero; private Float3 _max = Float3.zero; public Float3 Center { get { return (_min + _max) * 0.5f; } } public void Generate() { } public void Generate(List<Float3> listPt) { } public void Generate(Float3[] ptArray) { } #if Client public void Generate(UnityEngine.Mesh mesh) { } #endif public bool CheckIN() { return true; } } } ======================= File: Assets/Scripts/Voxelization/Contour/ContourData.cs ======================= <gh_stars>0 using System.Collections.Generic; using RayGraphics.Math; namespace RayGraphics.Voxelization { [System.Serializable] public class ContourData { /// <summary> /// 实际没什么用,用于保存生成数据时的设置 /// </summary> public int tileSize; /// <summary> /// 实际没什么用,用于保存生成数据时的设置 /// </summary> public int sdfValue; /// <summary> /// 实际没什么用,用于保存生成数据时的设置 /// </summary> public int width; /// <summary> /// 实际没什么用,用于保存生成数据时的设置 /// </summary> public int height; /// <summary> /// 区域地图 /// </summary> public List<ContourUnit> areaMaps = new List<ContourUnit>(); /// <summary> /// 关卡 /// </summary> public List<ContourUnit> Stages = new List<ContourUnit>(); /// <summary> /// 添加 area map 轮廓 /// </summary> /// <param name="unit"></param> public void AddAreaMap(ContourUnit unit) { if (unit == null) return; areaMaps.Add(unit); } /// <summary> /// 添加 关卡轮廓 /// </summary> /// <param name="unit"></param> public void AddStage(ContourUnit unit) { if (unit == null) return; Stages.Add(unit); } /// <summary> /// 清理 /// </summary> public void Clear() { foreach (ContourUnit unit in areaMaps) { unit.Clear(); } areaMaps.Clear(); foreach (ContourUnit unit in Stages) { unit.Clear(); } Stages.Clear(); } /// <summary> /// 分析连接关系 /// </summary> public void ParseDoorLink() { for (int i = 0; i < Stages.Count; i++) { DoorData d1 = Stages[i].minDoor; if (d1!= null) { d1.linkAreaMapID = ParseDoorLink(d1.InAraaMapPos); } DoorData d2 = Stages[i].maxDoor; if (d2!= null) { d2.linkAreaMapID = ParseDoorLink(d2.InAraaMapPos); } } } /// <summary> /// 分析点在那个子地图里面 /// </summary> /// <param name="pos"></param> /// <returns></returns> private int ParseDoorLink(Float2 pos) { for (int i = 0; i < areaMaps.Count; i++) { if (areaMaps[i].CheckIn(pos) == true) { return i; } } return -1; } } } ======================= File: Assets/Scripts/Voxelization/Grid/RLEGridMap.cs ======================= using System.Collections.Generic; using RayGraphics.Math; namespace RayGraphics.Voxelization { /// <summary> /// 存储有行程压缩的挡格地图数据 /// RLE(Run Length Encoding行程编码) /// </summary> public partial class RLEGridMap: TileBaseMap { /// <summary> /// 设置RLE(Run Length Encoding行程编码)格子数据, /// </summary> /// <param name="listRleBlockArray">(x,y)挡格起点,z挡格连续长度[X方向]</param> /// <returns></returns> public bool SetRleBlockData(List<Short3> listRleBlockArray) { if (_blockArray == null) return false; if (listRleBlockArray!= null && listRleBlockArray.Count > 0) { foreach (Short3 RleUnit in listRleBlockArray) { for (int x = 0; x <= RleUnit.z; x++) { _blockArray[RleUnit.y][RleUnit.x + x] = 1; } } } return true; } /// <summary> /// 生成rle 挡格数据 /// </summary> /// <returns></returns> public List<Short3> MakeRleBlock() { List<Short3> listRleBlockArray = new List<Short3>(); Short2 start = Short2.zero; Short2 prev = Short2.zero; bool isfirst = false; for (short y = 0; y < this.tileYnum; y++) { for (short x = 0; x < this.tileXnum; x++) { if (_blockArray[y][x] == 1) { if (isfirst == false) { start = new Short2(x, y); prev = start; isfirst = true; } else { if (y == start.y && x == prev.x + 1) { prev = new Short2(x, y); } else { listRleBlockArray.Add(new Short3(start.x, start.y, prev.x - start.x)); start = new Short2(x, y); prev = start; } } } } } if (start.y == this.tileYnum - 1 && prev.y == this.tileYnum - 1 && isfirst == true) { listRleBlockArray.Add(new Short3(start.x, start.y, prev.x - start.x)); } return listRleBlockArray; } /// <summary> /// 获取march cube value /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <returns></returns> public int GetSquareValue(int x, int y) { /* checking the 2x2 pixel grid, assigning these values to each pixel, if not transparent +---+---+ | 1 | 2 | +---+---+ | 1 | 8 | <- current pixel (pX,pY) +---+---+ */ int squareValue = 0; // checking upper left pixel if (CheckBlock(x - 1, y - 1) == true) { squareValue += 1; } // checking upper pixel if (CheckBlock(x, y - 1) == true) { squareValue += 2; } // checking left pixel if (CheckBlock(x - 1, y) == true) { squareValue += 4; } // checking the pixel itself if (CheckBlock(x, y) == true) { squareValue += 8; } return squareValue; } /// <summary> /// 裁剪挡格数据 /// </summary> /// <param name="ar"></param> /// <param name="listblock"></param> /// <param name="minPos"></param> /// <param name="maxPos"></param> /// <returns></returns> public bool CutBlockArea(StageGateArea ar, ref List<Short2> listblock, ref Short2 minPos, ref Short2 maxPos) { if (ar == null) return false; Float2 min = Float2.Min(ar.leftBottom, ar.rightUp); Float2 max = Float2.Max(ar.leftBottom, ar.rightUp); Short2 min2 = GetIndex(min); Short2 max2 = GetIndex(max); Short2 diff = max2 - min2; int width = diff.x + 1; int height = diff.y + 1; maxPos = min2; minPos = max2; List<Short2> list = new List<Short2>(); for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { Short2 pos = new Short2(x + min2.x, y + min2.y); if (CheckBlock(pos) == true) { list.Add(new Short2(x, y)); minPos = Short2.Min(minPos, pos); maxPos = Short2.Max(maxPos, pos); } } } if (listblock == null) { listblock = new List<Short2>(); } listblock.Clear(); foreach (Short2 pos in list) { listblock.Add(pos - (minPos - min2)); } return true; } /// <summary> /// 清理连续挡格。 /// </summary> /// <param name="pos"></param> public void EmptyContinuousBlock(Short2 pos) { if (CheckBlock(pos) == false) return; List<Short2> listOpenPts = new List<Short2>(); listOpenPts.Add(pos); while (listOpenPts.Count > 0) { Short2 p = listOpenPts[0]; listOpenPts.RemoveAt(0); if (CheckBlock(p) == false) { continue; } SetUnBlock(p); // 加入邻居1 Short2 p1 = p + Short2.left; if (CheckInMap(p1) && CheckBlock(p1) == true && listOpenPts.Contains(p1) == false) { listOpenPts.Add(p1); } // 加入邻居2 p1 = p + Short2.leftDown; if (CheckInMap(p1) && CheckBlock(p1) == true && listOpenPts.Contains(p1) == false) { listOpenPts.Add(p1); } // 加入邻居3 p1 = p + Short2.leftUp; if (CheckInMap(p1) && CheckBlock(p1) == true && listOpenPts.Contains(p1) == false) { listOpenPts.Add(p1); } // 加入邻居4 p1 = p + Short2.up; if (CheckInMap(p1) && CheckBlock(p1) == true && listOpenPts.Contains(p1) == false) { listOpenPts.Add(p1); } // 加入邻居5 p1 = p + Short2.down; if (CheckInMap(p1) && CheckBlock(p1) == true && listOpenPts.Contains(p1) == false) { listOpenPts.Add(p1); } // 加入邻居6 p1 = p + Short2.right; if (CheckInMap(p1) && CheckBlock(p1) == true && listOpenPts.Contains(p1) == false) { listOpenPts.Add(p1); } // 加入邻居7 p1 = p + Short2.rightUp; if (CheckInMap(p1) && CheckBlock(p1) == true && listOpenPts.Contains(p1) == false) { listOpenPts.Add(p1); } // 加入邻居8 p1 = p + Short2.rightDown; if (CheckInMap(p1) && CheckBlock(p1) == true && listOpenPts.Contains(p1) == false) { listOpenPts.Add(p1); } } } } } ======================= File: Assets/Scripts/Voxelization/AreaData.cs ======================= using System.Collections.Generic; using RayGraphics.Math; namespace RayGraphics.Voxelization { [System.Serializable] public class AreaData { public List<MapArea> myArea = new List<MapArea>(); public List<StageGateArea> mydoor = new List<StageGateArea>(); /// <summary> /// 生成轮廓数据 /// </summary> /// <param name="grid"></param> /// <param name="limitDistance"></param> /// <param name="ret"></param> public void GeneralContour(RLEGridMap grid, ref ContourData ret) { if (ret == null) { ret = new ContourData(); } ret.Clear(); ret.tileSize = (int)grid.TileSize; ret.sdfValue = (int)grid.SdfValue; ret.width = grid.tileXnum * ret.tileSize; ret.height = grid.tileYnum * ret.tileSize; float limitDistance = ret.tileSize; for (int i= 0; i< this.myArea.Count; i++) { MapArea submap = this.myArea[i]; ContourUnit unit = ContourOptimization.GeneralContourUnit(grid, submap, limitDistance); ret.AddAreaMap(unit); } for (int i = 0; i < this.mydoor.Count; i++) { StageGateArea stage = this.mydoor[i]; ContourUnit unit = ContourOptimization.GeneralContourUnit(grid, stage, limitDistance); unit.SetDoorData(stage.MindoorCenter, stage.MaxdoorCenter, stage.isXdir, grid.TileSize, i); ret.AddStage(unit); } // 分析连接关系 ret.ParseDoorLink(); } } [System.Serializable] public class MapArea : MapElement { public Float2 keyPoint; public override Float2 GetKeyPoint() { return keyPoint; } } } ======================= File: Assets/Scripts/Voxelization/StageDoorData.cs ======================= using System.Collections.Generic; using RayGraphics.Math; namespace RayGraphics.Voxelization { public class StageDoorData { /// <summary> /// 已经是偏移过的坐标系了。 /// </summary> public List<Short2> listblock = new List<Short2>(); public Short2 startPos; public int width; public int height; public bool _isXdir; public int _minAixs; public int _maxAixs; public int _minSecondAixs; public int _maxSecondAixs; public Short2[] listWalkData = null; /// <summary> /// /// </summary> /// <param name="min2"></param> /// <param name="max2"></param> /// <param name="blocks"></param> /// <param name="isXdir"></param> /// <returns></returns> public bool CutdoorblockArea(Short2 min2, Short2 max2, List<Short2> blocks, bool isXdir) { this._isXdir = isXdir; int min = int.MaxValue; int max = int.MinValue; foreach (Short2 pos in blocks) { if (isXdir == true) { min = System.Math.Min(min, pos.x); max = System.Math.Max(max, pos.x); } else { min = System.Math.Min(min, pos.y); max = System.Math.Max(max, pos.y); } } Short2 maxPos = min2; Short2 minPos = max2; for (int i = 0; i < blocks.Count;) { if (isXdir == true) { if (blocks[i].x < min || blocks[i].x > max) { blocks.RemoveAt(i); continue; } minPos = Short2.Min(minPos, blocks[i] + min2); maxPos = Short2.Max(maxPos, blocks[i] + min2); } else { if (blocks[i].y < min || blocks[i].y > max) { listblock.RemoveAt(i); continue; } minPos = Short2.Min(minPos, blocks[i] + min2); maxPos = Short2.Max(maxPos, blocks[i] + min2); } i++; } if (listblock == null) { listblock = new List<Short2>(); } else listblock.Clear(); foreach (Short2 pos in blocks) { listblock.Add(pos - (minPos - min2)); } this.startPos = minPos; Short2 diff = maxPos - minPos; this.width = diff.x + 1; this.height = diff.y + 1; ParseMinAixs(); ParseMaxAixs(); GetSecondAixs(); return true; } /// <summary> /// 获取近 /// </summary> private void ParseMinAixs() { if (listblock == null || listblock.Count == 0) { _minAixs = 0; return; } if (this._isXdir == false) { for (int i = 0; i < this.width; i++) { bool ishave = false; foreach (Short2 pos in listblock) { if (pos.x == i) { ishave = true; break; } } if (ishave == false) { _minAixs = i; break; } } } else { for (int i = 0; i < this.height; i++) { bool ishave = false; foreach (Short2 pos in listblock) { if (pos.y == i) { ishave = true; break; } } if (ishave == false) { _minAixs = i; break; } } } } /// <summary> /// 获取远 /// </summary> private void ParseMaxAixs() { if (listblock == null || listblock.Count == 0) { if (this._isXdir == false) { _maxAixs = this.width - 1; } else { _maxAixs = this.height - 1; } return; } if (this._isXdir == false) { for (int i = this.width - 1; i >= 0; i--) { bool ishave = false; foreach (Short2 pos in listblock) { if (pos.x == i) { ishave = true; break; } } if (ishave == false) { _maxAixs = i; break; } } } else { for (int i = this.height - 1; i >= 0; i--) { bool ishave = false; foreach (Short2 pos in listblock) { if (pos.y == i) { ishave = true; break; } } if (ishave == false) { _maxAixs = i; break; } } } } /// <summary> /// 获取第二轴。 /// </summary> public void GetSecondAixs() { int min1; int min2; int max1; int max2; if (this._isXdir == true) { min1 = this.width - 1; min2 = this.width - 1; max1 = 0; max2 = 0; foreach (Short2 pos in listblock) { if (pos.y < this._minAixs) { min1 = System.Math.Min(min1, pos.x); max1 = System.Math.Max(max1, pos.x); } else if (pos.y > this._maxAixs) { min2 = System.Math.Min(min2, pos.x); max2 = System.Math.Max(max2, pos.x); } } } else { min1 = this.height - 1; min2 = this.height - 1; max1 = 0; max2 = 0; foreach (Short2 pos in listblock) { if (pos.x < this._minAixs) { min1 = System.Math.Min(min1, pos.y); max1 = System.Math.Max(max1, pos.y); } else if (pos.x > this._maxAixs) { min2 = System.Math.Min(min2, pos.y); max2 = System.Math.Max(max2, pos.y); } } } this._minSecondAixs = System.Math.Max(min1, min2); this._maxSecondAixs = System.Math.Min(max1, max2); } /// <summary> /// 获取边缘点 /// </summary> /// <param name="listB"></param> public void GetContourData(ref List<Short2> listB, ref Float2 MindoorCenter, ref Float2 MaxdoorCenter) { if (this._isXdir == true) { listWalkData = new Short2[this.width]; for (int i = this._minSecondAixs; i <= this._maxSecondAixs; i++) { int min = this._minAixs; // 获取小。 for (int y = this._minAixs; y >= 0; y--) { if (CheckNearBlockPoint(new Short2(i, y), new Short2(i, y - 1)) == true) { min = y; break; } } // 获取大的。 int max = this._maxAixs; for (int y = this._maxAixs; y < this.height; y++) { if (CheckNearBlockPoint(new Short2(i, y), new Short2(i, y + 1)) == true) { max = y; break; } } listWalkData[i] = new Short2(min, max); } } else { listWalkData = new Short2[this.height]; for (int i = this._minSecondAixs; i <= this._maxSecondAixs; i++) { int min = this._minAixs; // 获取小。 for (int x = this._minAixs; x >= 0; x--) { if (CheckNearBlockPoint(new Short2(x, i), new Short2(x - 1, i)) == true) { min = x; break; } } // 获取大的。 int max = this._maxAixs; for (int x = this._maxAixs; x < this.width; x++) { if (CheckNearBlockPoint(new Short2(x, i), new Short2(x + 1, i)) == true) { max = x; break; } } listWalkData[i] = new Short2(min, max); } } if (listB == null) { listB = new List<Short2>(); } else listB.Clear(); if (this._isXdir == true) { for (int i = this._minSecondAixs; i <= this._maxSecondAixs; i++) { Short2 ll = listWalkData[i]; // 获取小。 if (i == this._minSecondAixs || i == this._maxSecondAixs) { for (int y = ll.x; y <= ll.y; y++) { listB.Add(new Short2(i, y)); } if (i == this._minSecondAixs) { MindoorCenter = new Float2(this._minSecondAixs, (ll.x + ll.y) * 0.5f); } else if (i == this._maxSecondAixs) { // 不知道为什么要+1 先这样改正 MaxdoorCenter = new Float2(this._maxSecondAixs + 1, (ll.x + ll.y) * 0.5f); } } } } else { for (int i = this._minSecondAixs; i <= this._maxSecondAixs; i++) { Short2 ll = listWalkData[i]; // 获取小。 if (i == this._minSecondAixs || i == this._maxSecondAixs) { for (int x = ll.x; x <= ll.y; x++) { listB.Add(new Short2(x, i)); } if (i == this._minSecondAixs) { MindoorCenter = new Float2((ll.x + ll.y) * 0.5f, this._minSecondAixs); } else if (i == this._maxSecondAixs) { // 不知道为什么要+1 先这样改正 MaxdoorCenter = new Float2((ll.x + ll.y) * 0.5f,this._maxSecondAixs + 1); } } } } // 算上世界位置。 for (int i = 0; i < listB.Count; i++) { listB[i] += startPos; } MindoorCenter += new Float2(startPos.x, startPos.y); MaxdoorCenter += new Float2(startPos.x, startPos.y); } /// <summary> /// 边缘点 /// </summary> /// <param name="pos"></param> /// <param name="nextPos"></param> /// <returns></returns> public bool CheckNearBlockPoint(Short2 pos, Short2 nextPos) { if (this.listblock.Contains(pos) == false && this.listblock.Contains(nextPos) == true) return true; else return false; } } } ======================= File: Assets/Scripts/Graphics/Tree/BspTree.cs ======================= using System.Collections.Generic; using RayGraphics.Math; namespace RayGraphics.Tree { /// <summary> /// Binary space partitioning,BSP bsp tree /// </summary> public class BspTree : Itree { public void BuildTree(Double2 min, Double2 max, List<TreeData> listData) { } } } ======================= File: Assets/Scripts/Graphics/Geometric/2D/Circle2D.cs ======================= using RayGraphics.Math; using System.Collections.Generic; namespace RayGraphics.Geometric { [System.Serializable] public class Circle2D : AABB2D { /// <summary> /// 中心 /// </summary> public Double2 circleCenter; /// <summary> /// 半径 /// </summary> public double radius; public Circle2D(Double2 center, double radius) { this.circleCenter = center; this.radius = radius; this.SetAABB(center - Double2.one * radius, center + Double2.one * radius); } /// <summary> /// 创建外接圆 /// </summary> /// <param name="p1"></param> /// <param name="p2"></param> /// <param name="p3"></param> /// <returns></returns> public static Circle2D CreateCircumCircle(Double2 p1, Double2 p2, Double2 p3) { // 排除三点共线 Double2 diff1 = p2 - p1; Double2 diff2 = p3 - p1; if (diff1 == Double2.zero || diff2 == Double2.zero) return null; double value = Double2.Cross(diff1, diff2); if (System.Math.Abs(value) < MathUtil.kEpsilon) { return null; } // 2垂直平分线就是圆心。 Double2 mid1 = p1 + diff1 * 0.5f; Double2 mid2 = p1 + diff2 * 0.5f; Line2D line1 = new Line2D(mid1, Double2.Perpendicular(diff1)); Line2D line2 = new Line2D(mid2, Double2.Perpendicular(diff2)); Double2 center = Double2.zero; if (line1.GetIntersectPoint(line2, ref center) == true) { double radius = (center - p1).magnitude; return new Circle2D(center, radius); } else return null; } /// <summary> /// 创建内接圆 /// </summary> /// <param name="p1"></param> /// <param name="p2"></param> /// <param name="p3"></param> /// <returns></returns> public static Circle2D CreateInscribedCircle(Double2 p1, Double2 p2, Double2 p3) { // 排除三点共线 Double2 diff1 = p2 - p1; Double2 diff2 = p3 - p1; if (diff1 == Double2.zero || diff2 == Double2.zero) return null; double value = Double2.Cross(diff1, diff2); if (System.Math.Abs(value) < MathUtil.kEpsilon) { return null; } // 2垂直平分线就是圆心。 Double2 mid1dir = diff1.normalized + diff2.normalized; Double2 mid2dir = (p3 - p2).normalized - diff1.normalized; Line2D line1 = new Line2D(p1, mid1dir); Line2D line2 = new Line2D(p2, mid2dir); Double2 center = Double2.zero; if (line1.GetIntersectPoint(line2, ref center) == true) { double radius = line1.CalcDistance(center); return new Circle2D(center, radius); } else return null; } /// <summary> /// 获取近的相交点 /// </summary> /// <param name="line"></param> /// <param name="intersectStart"></param> /// <returns></returns> public override bool GetNearIntersectPoint(LineSegment2D line, ref Double2 intersectStart) { double radis2 = this.radius * this.radius; Double2 projectoint = line.ProjectPoint(this.circleCenter); Double2 diff = this.circleCenter - projectoint; // 跟直线相交奥 double dis = diff.sqrMagnitude - radis2; if (dis < 0) { double dis1 = (this.circleCenter - line.startPoint).sqrMagnitude; double dis2 = (this.circleCenter - line.endPoint).sqrMagnitude; if (dis1 >= radis2 && dis2 <= radis2) { dis = System.Math.Sqrt(dis); intersectStart = projectoint - line.normalizedDir * dis; return true; } else if (dis1 <= radis2 && dis2 >= radis2) { dis = System.Math.Sqrt(dis); intersectStart = projectoint + line.normalizedDir * dis; return true; } } return false; } /// <summary> /// 最短射线包围盒路径 /// </summary> /// <param name="line">线段</param> /// <param name="offset">偏移值</param> /// <param name="rbi">包围盒信息</param> /// <returns>true,表示线段与aabb有相交,并返回最短包围路径</returns> public override RBIResultType RayboundingNearestPath(LineSegment2D line, double offset, ref RayboundingInfo rbi) { if (rbi == null) { rbi = new RayboundingInfo(); } Double2 diff = this.circleCenter - line.startPoint; if (diff == Double2.zero) return RBIResultType.Fail; // Double2 projectoint = line.ProjectPoint(this.circleCenter); diff = this.circleCenter - projectoint; // 跟直线相交奥 double dis = diff.sqrMagnitude - this.radius * this.radius; if (dis >= 0) return RBIResultType.Fail; dis = -dis; // 在同侧不行。 Double2 diff1 = line.startPoint - projectoint; Double2 diff2 = line.endPoint - projectoint; if (Double2.Dot(diff1, diff2) >= 0) return RBIResultType.Fail; // if (diff1.sqrMagnitude < dis || diff2.sqrMagnitude < dis) return RBIResultType.Fail; dis = System.Math.Sqrt(dis) + offset; Double2 p1 = projectoint - line.normalizedDir * dis; Double2 p2 = projectoint + line.normalizedDir * dis; double bigRadius = this.radius + offset; double angle = SignedAngleInCircle(p1 - this.circleCenter, p2 - this.circleCenter, bigRadius); int count = (int)(System.Math.Abs(angle / 0.25f)); double diffangle = angle / count; List<Double2> listpath = new List<Double2>(); Double2 startVector = (p1 - this.circleCenter).normalized * bigRadius; for (int i = 1; i <= count - 1; i++) { Double2 rorateVector = Double2.Rotate(startVector, -diffangle * i); listpath.Add(rorateVector + this.circleCenter); } rbi.listpath = listpath; if (rbi.listpath!= null && rbi.listpath.Count > 0) { rbi.CalcHelpData(line, offset, p1, p2); return RBIResultType.Succ; } return RBIResultType.Fail; } /// <summary> /// 圆弧上的2个向量夹角 /// </summary> /// <param name="from"></param> /// <param name="to"></param> /// <returns></returns> private double SignedAngleInCircle(Double2 from, Double2 to, double r) { // [-PI / 2, PI /2] Asin // [0, PI] acos double sqrRadius = r * r; double sinValue = Double2.Cross(from, to) / sqrRadius; sinValue = System.Math.Min(sinValue, 1.0f); sinValue = System.Math.Max(sinValue, -1.0f); double cosValue = Double2.Dot(from, to) / sqrRadius; cosValue = System.Math.Min(cosValue, 1.0f); cosValue = System.Math.Max(cosValue, -1.0f); return MathFunc.GetAngle(cosValue, sinValue); } /// <summary> /// 判断点是否在直线上 /// </summary> /// <param name="pt"></param> /// <returns></returns> public override bool CheckIn(Double2 pt) { Double2 diff = this.circleCenter - pt; if (diff.sqrMagnitude <= this.radius * this.radius) return true; else return false; } /// <summary> /// 与直线的关系 /// </summary> /// <param name="line"></param> /// <returns></returns> public override LineRelation CheckLineRelation(Line2D line) { Double2 diff = this.circleCenter - line.startPoint; if (diff == Double2.zero) return LineRelation.Intersect; // Double2 projectoint = line.ProjectPoint(this.circleCenter); diff = this.circleCenter - projectoint; if (diff.sqrMagnitude <= this.radius * this.radius) return LineRelation.Intersect; else return LineRelation.Detach; } /// <summary> /// 直线与射线间的关系 /// </summary> /// <param name="line"></param> /// <returns></returns> public override LineRelation CheckLineRelation(Rays2D line) { if (CheckIn(line.startPoint) == true) { return LineRelation.Intersect; } double dis = line.AixsVector(this.circleCenter).sqrMagnitude - this.radius * this.radius; if (dis < 0) { Double2 diff = this.circleCenter - line.startPoint; if (Double2.Dot(diff, line.normalizedDir) > 0) return LineRelation.Intersect; else return LineRelation.Detach; } else return LineRelation.Detach; } /// <summary> /// 与线段的关系 /// </summary> /// <param name="line"></param> /// <returns></returns> public override LineRelation CheckLineRelation(LineSegment2D line) { double dis = line.CalcDistance(this.circleCenter); if (dis > this.radius) return LineRelation.Detach; else { double sqrRadius = this.radius * this.radius; if ((this.circleCenter - line.startPoint).sqrMagnitude > sqrRadius) { return LineRelation.Intersect; } if ((this.circleCenter - line.endPoint).sqrMagnitude > sqrRadius) { return LineRelation.Intersect; } return LineRelation.Coincide; } } /// <summary> /// 获取挡格附近出生点 /// </summary> /// <param name="line"></param> /// <param name="offset"></param> /// <param name="bornPoint"></param> /// <returns></returns> public override bool GetBornPoint(LineSegment2D line, double offset, ref Double2 bornPoint) { Double2 dirNormal = line.normalizedDir; Double2 diff = this.circleCenter - line.startPoint; if (diff == Double2.zero) { bornPoint = line.startPoint + line.normalizedDir * (this.radius + offset); return true; } else { Double2 projectoint = Double2.Project(diff, dirNormal) + line.startPoint; diff = this.circleCenter - projectoint; double dis = this.radius * this.radius - diff.sqrMagnitude; if (dis <= 0) { return false; } else { dis = (float)System.Math.Sqrt(dis) + offset; double value = Double2.Dot(dirNormal, line.endPoint - projectoint); if (value > 0) { bornPoint = projectoint + dirNormal * dis; } else { bornPoint = projectoint - dirNormal * dis; } return true; } } } /// <summary> /// 与矩形的关系 /// </summary> /// <param name="dbd1"></param> /// <returns>true 相交: false 不相交</returns> public override bool CheckIntersect(Rect2D ab) { if (ab == null) return false; if (ab.CheckIn(this.circleCenter) == true) return true; for (int i = 0; i < ab.GetEdgeNum(); i++) { LineSegment2D ls = ab.GetEdge(i); if (this.CheckLineRelation(ls)!= LineRelation.Detach) { return true; } } return false; } /// <summary> /// 与圆的关系 /// </summary> /// <param name="dbd1"></param> /// <returns>true 相交: false 不相交</returns> public override bool CheckIntersect(Circle2D ab) { if (ab == null) return false; Double2 diff = this.circleCenter - ab.circleCenter; if (diff.magnitude > (this.radius + ab.radius)) { return false; } else return true; } /// <summary> /// 与多边形的关系 /// </summary> /// <param name="ab"></param> /// <returns>true 相交: false 不相交</returns> public override bool CheckIntersect(Polygon2D ab) { if (ab == null) return false; if (ab.CheckIn(this.circleCenter) == true) return true; for (int i = 0; i < ab.GetEdgeNum(); i++) { LineSegment2D ls = ab.GetEdge(i); if (this.CheckLineRelation(ls)!= LineRelation.Detach) { return true; } } return false; } /// <summary> /// 求外部点到圆的切线 /// </summary> /// <param name="outPoint">在圆上/圆内不计算切线</param> /// <param name="leftTangent">逆时针切线</param> /// <param name="rightTangent">顺时针切线</param> /// <returns></returns> public bool GetTangent(Double2 outPoint,ref Double2 leftTangent, ref Double2 rightTangent) { Double2 diff = this.circleCenter - outPoint; double sqrDiff = diff.sqrMagnitude; double sqrRadius = this.radius * this.radius; // 先求切线的长度sqr double sqrtLen = sqrDiff - sqrRadius; if (sqrtLen <= 0) { return false; } else { // 再求斜边的高度平方 double sqrHeight = sqrtLen * sqrRadius / sqrDiff; // 求垂线。 Double2 aix = -Double2.Perpendicular(diff); // 再求斜边的垂足。 double value = (sqrtLen - sqrHeight) / sqrDiff; Double2 aixPos = System.Math.Sqrt((float)value) * diff + outPoint; // 再求2个切点。 double height = System.Math.Sqrt((float)sqrHeight); leftTangent = aixPos - aix.normalized * height - outPoint; rightTangent = aixPos + aix.normalized * height - outPoint; return true; } } } } ======================= File: Assets/Scripts/Graphics/bounding/Sphere.cs ======================= using System.Collections.Generic; using RayGraphics.Math; namespace RayGraphics.Bounding { /// <summary> /// 球形包围盒 /// </summary> public class Sphere : IBounding { public void Generate() { } public void Generate(List<Float3> listPt) { } public void Generate(Float3[] ptArray) { } #if Client public void Generate(UnityEngine.Mesh mesh) { } #endif public bool CheckIN() { return true; } } } ======================= File: Assets/Scripts/Graphics/Triangulation2D/Trapezoid.cs ======================= <reponame>741645596/graph using RayGraphics.Geometric; namespace RayGraphics.Triangulation { /// <summary> /// 梯形 /// </summary> public class Trapezoid { /// <summary> /// 左边 /// </summary> public Edge left; /// <summary> /// 右边 /// </summary> public Edge right; /// <summary> /// helper 点 /// </summary> public VertexInfo helper; /// <summary> /// 得到X坐标 /// </summary> public float X { get { return helper.pos.x; } } /// <summary> /// 构造函数 /// </summary> /// <param name="left">保证不为组合点</param> /// <param name="right">保证不为组合点</param> /// <param name="helper">保证不为组合点</param> public Trapezoid(Edge left, Edge right, VertexInfo helper) { this.left = left; this.right = right; this.helper = helper; } /// <summary> /// 已经确定可以合并了,梯形增长 /// </summary> /// <param name="ScanPoints">扫描线点</param> /// <param name="parent"></param> public void Growth(VertexInfo ScanPoints, PolygonChain parent) { if (this.left.end.CheckHit(ScanPoints) == true) { this.left = ScanPoints.GetGrowEdge(this.left, ref this.helper, parent); } else if (this.right.end.CheckHit(ScanPoints) == true) { this.right = ScanPoints.GetGrowEdge(this.right, ref this.helper, parent); } } /// <summary> /// 合并梯形 /// </summary> /// <param name="left"></param> /// <param name="right"></param> /// <param name="ScanPoints">扫描线点</param> /// <returns></returns> public static Trapezoid CombineTrapezoid(Trapezoid left, Trapezoid right, VertexInfo ScanPoints) { return new Trapezoid(left.left, right.right, ScanPoints.GetLeftPoint()); } /// <summary> /// 判断目标点是梯形夹边中。 /// </summary> /// <param name="target"></param> /// <returns></returns> public bool CheckIn(VertexInfo target, bool isYdown) { if (isYdown == true) { // 需在左侧 if (left.CheckLeft(target) == false) return false; // 需在右侧 if (right.CheckLeft(target) == true) return false; return true; } else { // 需在左侧 if (left.CheckLeft(target) == true) return false; // 需在右侧 if (right.CheckLeft(target) == false) return false; return true; } } /// <summary> /// 确定在边上 /// </summary> /// <param name="ScanPoints">扫描线点,可能为符合点</param> /// <returns></returns> public Edge CheckInEdge(VertexInfo ScanPoints) { if (left.end.CheckHit(ScanPoints) == true) return left; else if (right.end.CheckHit(ScanPoints) == true) return right; return null; } /// <summary> /// 判断是否为无效的梯形 /// </summary> /// <returns>true 无效梯形, false 有效</returns> public bool CheckInvalid() { if (this.left.start.indexInPolygonChain == this.right.end.indexInPolygonChain && this.left.end.indexInPolygonChain == this.right.start.indexInPolygonChain) { return true; } // 退化的梯形 else if (this.right.end.indexInPolygonChain == this.left.end.indexInPolygonChain) { return true; } else if (this.left.CheckLevelEdge() == true || this.right.CheckLevelEdge() == true) { return true; } else { return false; } } /// <summary> /// 没面积的梯形,一条边的终点 等于一条边的起点高度,特指这类梯形 /// 边的节点== end /// </summary> /// <returns></returns> public bool CheckNoArea() { if (this.left.end.pos.y == this.right.start.pos.y || this.left.start.pos.y == this.right.end.pos.y) return true; else return false; } public void Print() { string str = "left:" + left.Print() + " right:" + right.Print() + " helper:" + "[" + helper.pos.x + "," + helper.pos.y + "]"; UnityEngine.Debug.Log(str); } } /// <summary> /// 边 /// </summary> public class Edge { public VertexInfo start; public VertexInfo end; public Edge(VertexInfo start, VertexInfo end) { this.start = start; this.end = end; } /// <summary> /// 判断目标点是在左侧 /// </summary> /// <param name="target"></param> /// <returns></returns> public bool CheckLeft(VertexInfo target) { return GeometricUtil.LeftSide(start.pos, end.pos, target.pos); } /// <summary> /// 判断是否为水平边,y 值相同 /// </summary> /// <returns></returns> public bool CheckLevelEdge() { if (start.pos.y == end.pos.y) return true; else return false; } public string Print() { return "[" + start.pos.x + "," + start.pos.y + "]->[" + end.pos.x + "," + end.pos.y + "]"; } } } ======================= File: Assets/Scripts/Graphics/Triangulation2D/MonotonePolygon.cs ======================= using System.Collections.Generic; using RayGraphics.Math; using RayGraphics.Geometric; namespace RayGraphics.Triangulation { /// <summary> /// 单调多边形 /// </summary> public class MonotonePolygon { /// <summary> /// 单调链- left -单调降 /// </summary> private List<TriVertexInfo> left = new List<TriVertexInfo>(); /// <summary> /// 单调链 - right - 单调降 /// </summary> private List<TriVertexInfo> right = new List<TriVertexInfo>(); /// <summary> /// 构造函数 /// </summary> /// <param name="listPoints">为逆时针序列,且为单调多边形</param> public MonotonePolygon(List<VertexInfo> listPoints) { // 先判断是否为单调多边形 /*if (CheckMonotonePolygon(listPoints) == false) { UnityEngine.Debug.Log("非单调多边形"); }*/ int count = listPoints.Count; // 找最小 float targetY; int minIndex = -1; float minValue = float.MaxValue; for (int i = 0; i < count; i++) { int prev = (i - 1) < 0? (count - 1):(i - 1); int next = (i + 1) >= count? 0 : (i + 1); targetY = listPoints[i].pos.y; if (targetY < listPoints[prev].pos.y && targetY <= listPoints[next].pos.y && targetY <= minValue) { minIndex = i; minValue = targetY; } } if (minIndex == -1) return; // 找最大 int maxIndex = -1; float maxValue = float.MinValue; for (int i = 0; i < count; i++) { int prev = (i - 1) < 0? (count - 1) : (i - 1); int next = (i + 1) >= count? 0 : (i + 1); targetY = listPoints[i].pos.y; if (targetY >= listPoints[prev].pos.y && targetY > listPoints[next].pos.y && targetY >=maxValue) { maxIndex = i; maxValue = targetY; } } if (maxIndex == -1) return; // 得到单调链 if (maxIndex > minIndex) { // left for (int i = maxIndex + 1; i < count; i++) { this.left.Add(new TriVertexInfo(listPoints[i], SideType.Left)); } for (int i = 0; i < minIndex; i++) { this.left.Add(new TriVertexInfo(listPoints[i], SideType.Left)); } // right for (int i = maxIndex ; i >= minIndex; i--) { SideType type = (i == maxIndex || i == minIndex)? SideType.Center : SideType.Right; this.right.Add(new TriVertexInfo(listPoints[i], type)); } } else if (maxIndex < minIndex) { // left for (int i = maxIndex + 1; i < minIndex; i++) { this.left.Add(new TriVertexInfo(listPoints[i], SideType.Left)); } // right for (int i = maxIndex; i >= 0; i--) { SideType type = (i == maxIndex || i == minIndex)? SideType.Center : SideType.Right; this.right.Add(new TriVertexInfo(listPoints[i], type)); } for (int i = count -1; i >= minIndex; i--) { SideType type = (i == maxIndex || i == minIndex)? SideType.Center : SideType.Right; this.right.Add(new TriVertexInfo(listPoints[i], type)); } } } /// <summary> /// 生成三角形列表 /// </summary> /// <param name="listTri"></param> public void GeneralTri(ref List<Index3> listTri) { if (listTri == null) { listTri = new List<Index3>(); } // 初始化动作 Stack<TriVertexInfo> WaitPoint = new Stack<TriVertexInfo>(); WaitPoint.Push(GetBestPoint()); WaitPoint.Push(GetBestPoint()); TriVertexInfo newPoint; while ((newPoint = GetBestPoint())!= null) { while (WaitPoint.Count > 1) { TriVertexInfo stackUp = WaitPoint.Pop(); TriVertexInfo stackDown = WaitPoint.Pop(); // 判断与stack 顶元素是否同意侧 if (newPoint.sideType == stackUp.sideType) { bool isLeft = GeometricUtil.LeftSide(stackDown.pos, stackUp.pos, newPoint.pos); if ((newPoint.sideType == SideType.Left && isLeft == true) ||(newPoint.sideType == SideType.Right && isLeft == false)) {//不是凹的 // 得到三角形 AddTri(ref listTri, stackDown, stackUp, newPoint); WaitPoint.Push(stackDown); } else // 无发够成三角形 { WaitPoint.Push(stackDown); WaitPoint.Push(stackUp); break; } } else // 异侧 { // 得到三角形 AddTri(ref listTri, stackDown, stackUp, newPoint); TriVertexInfo botton = stackUp; if (WaitPoint.Count > 0) { while (WaitPoint.Count > 0) { stackUp = stackDown; stackDown = WaitPoint.Pop(); AddTri(ref listTri, stackDown, stackUp, newPoint); } } WaitPoint.Push(botton); } } WaitPoint.Push(newPoint); } } /// <summary> /// 添加三角形 /// </summary> /// <param name="listTri"></param> /// <param name="a"></param> /// <param name="b"></param> /// <param name="c"></param> private void AddTri(ref List<Index3> listTri, TriVertexInfo a, TriVertexInfo b, TriVertexInfo c) { // 得到三角形 if (b.sideType == SideType.Left) { listTri.Add(new Index3(c.index, b.index, a.index)); } else { listTri.Add(new Index3(a.index, b.index, c.index)); } } /// <summary> /// 回去最合适的点 /// </summary> /// <returns></returns> private TriVertexInfo GetBestPoint() { TriVertexInfo ret = null; int leftCount = this.left.Count; int rightCount = this.right.Count; if (leftCount == 0 && rightCount == 0) return ret; if (leftCount == 0) { ret = this.right[0]; this.right.RemoveAt(0); return ret; } else if (rightCount == 0) { ret = this.left[0]; this.left.RemoveAt(0); return ret; } else if (this.left[0].pos.y >= this.right[0].pos.y) { ret = this.left[0]; this.left.RemoveAt(0); return ret; } else { ret = this.right[0]; this.right.RemoveAt(0); return ret; } } /// <summary> /// 判断是否为单调多边形 /// </summary> /// <param name="listPoints"></param> /// <returns></returns> public static bool CheckMonotonePolygon(List<VertexInfo> listPoints) { if (listPoints == null) return false; int count = listPoints.Count; if (count < 3) return false; // 找最小 int minIndex = -1; float minValue = float.MaxValue; for (int i = 0; i < count; i++) { if (listPoints[i].pos.y < minValue) { minIndex = i; minValue = listPoints[i].pos.y; } } if (minIndex == -1) return false; // 找最大 int maxIndex = -1; float maxValue = float.MinValue; for (int i = 0; i < count; i++) { if (listPoints[i].pos.y >= maxValue) { maxIndex = i; maxValue = listPoints[i].pos.y; } } if (maxIndex == -1) return false; // 得到单调链 if (maxIndex > minIndex) { for (int i = maxIndex; i > minIndex; i--) { if (listPoints[i].pos.y < listPoints[i - 1].pos.y) { return false; } } for (int i = maxIndex; i < count; i++) { int next = i + 1; if (next == count) { next = 0; } if (listPoints[i].pos.y < listPoints[next].pos.y) { return false; } } for (int i = 0; i < minIndex -1; i ++) { int next = i + 1; if (listPoints[i].pos.y < listPoints[next].pos.y) { return false; } } } else if (maxIndex < minIndex) { for (int i = maxIndex; i < minIndex; i++) { if (listPoints[i].pos.y < listPoints[i + 1].pos.y) { return false; } } for (int i = maxIndex; i < count; i++) { int next = i + 1; if (next == count) { next = 0; } if (listPoints[i].pos.y < listPoints[next].pos.y) { return false; } } for (int i = 0; i < minIndex - 1; i++) { int next = i + 1; if (listPoints[i].pos.y < listPoints[next].pos.y) { return false; } } } return true; } } public class TriVertexInfo { public TriVertexInfo(VertexInfo v, SideType isLeft) { this.pos = v.pos; this.index = v.fixIndex; this.sideType = isLeft; } /// <summary> /// 顶点数据 /// </summary> public Float2 pos; /// <summary> /// 所在顶点列表中的索引 /// </summary> public int index; /// <summary> /// 是否左链的点 /// </summary> public SideType sideType; } public enum SideType { Center = 0, // 顶部,或底部元素 Left = 1, // 左链 Right = 2, // 右链 } } ======================= File: Assets/Scripts/Graphics/Transform/EulerAngles.cs ======================= <filename>Assets/Scripts/Graphics/Transform/EulerAngles.cs namespace RayGraphics.Transform { public class EulerAngles { } } ======================= File: Assets/Scripts/Graphics/HashCode/HashCodeHelp.cs ======================= <gh_stars>0 using System; /// <summary> /// https://blog.csdn.net/pkueecser/article/details/15504753 /// </summary> namespace RayGraphics.Math { /// <summary> /// hash函数 /// </summary> public class HashCodeHelp { /// <summary> /// String中hashCode方法 /// 算法:s[0]*31^(n-1) + s[1]*31^(n-2) + … + s[n-1] /// </summary> /// <returns></returns> public int hashCode(string value) { int hash = 0; if (hash == 0 && value.Length > 0) { for (int i = 0; i < value.Length; i++) { hash = 31 * hash + value[i]; } } return hash; } /// <summary> /// 一个比较好的字符串hash算法,add到这里,听说是微软用 /// 这个算法要保证str的长度是8的倍数,如果不够用0补齐, /// 不然会导致越界,计算出的hash就不准确了。 /// </summary> /// <param name="value"></param> /// <returns></returns> uint getHashCode(string value) { /*uint32_t chPtr[MAX_LEN]; memset(chPtr,0,sizeof(chPtr)); int length = strlen(str); memcpy(chPtr, str, length); UINT32 num = 0x15051505; UINT32 num2 = num; UINT32* numPtr = (UINT32*)chPtr; int i = 0; for(i=length;i>0;i-=4) { num = (((num << 5) + num) + (num >> 0x1b)) ^ numPtr[0]; if(i<=2) break; num2=(((num2 << 5) + num2) + (num2 >> 0x1b)) ^ numPtr[1]; numPtr+=2; } return (num + (num2* 0x5d588b65));*/ return 0; } /// <summary> /// /// </summary> /// <param name="value"></param> /// <returns></returns> public uint SDBMHash(string value) { uint hash = 0; foreach(char c in value) { hash = c + (hash << 6) + (hash << 16) - hash; } return (hash & 0x7FFFFFFF); } /// <summary> /// RS Hash Function /// </summary> /// <param name="value"></param> /// <returns></returns> public uint RSHash(string value) { uint b = 378551; uint a = 63689; uint hash = 0; foreach (char c in value) { hash = hash * a + c; a *= b; } return (hash & 0x7FFFFFFF); } /// <summary> /// JS Hash Function /// </summary> /// <param name="value"></param> /// <returns></returns> public uint JSHash(string value) { uint hash = 1315423911; foreach (char c in value) { hash ^= ((hash << 5) + c + (hash >> 2)); } return (hash & 0x7FFFFFFF); } /// <summary> /// <NAME>. Weinberger Hash Function /// </summary> /// <param name="value"></param> /// <returns></returns> public uint PJWHash(string value) { uint hash = 0; /*uint BitsInUnignedInt = (unsigned int)(sizeof(unsigned int) *8); uint ThreeQuarters = (unsigned int)((BitsInUnignedInt * 3) / 4); uint OneEighth = (unsigned int)(BitsInUnignedInt / 8); uint HighBits = (unsigned int)(0xFFFFFFFF) << (BitsInUnignedInt - OneEighth); uint hash = 0; uint test = 0; foreach (char c in value) { hash = (hash << OneEighth) + c; if ((test = hash & HighBits)!= 0) { hash = ((hash ^ (test >> ThreeQuarters)) & (~HighBits)); } }*/ return (hash & 0x7FFFFFFF); } /// <summary> /// ELF Hash Function /// </summary> /// <param name="value"></param> /// <returns></returns> public uint ELFHash(string value) { uint hash = 0; uint x; foreach (char c in value) { hash = (hash << 4) + c; if ((x = hash & 0xF0000000)!= 0) { hash ^= (x >> 24); hash &= ~x; } } return (hash & 0x7FFFFFFF); } /// <summary> /// BKDR Hash Function /// </summary> /// <param name="value"></param> /// <returns></returns> public uint BKDRHash(string value) { uint seed = 131; // 31 131 1313 13131 131313 etc.. uint hash = 0; foreach (char c in value) { hash = hash * seed + c; } return (hash & 0x7FFFFFFF); } /// <summary> /// DJB Hash Function /// </summary> /// <param name="value"></param> /// <returns></returns> public uint DJBHash(string value) { uint hash = 5381; foreach (char c in value) { hash += (hash << 5) + c; } return (hash & 0x7FFFFFFF); } /// <summary> /// AP Hash Function /// </summary> /// <param name="value"></param> /// <returns></returns> public uint APHash(string value) { uint hash = 0; int i =0; foreach (char c in value) { if ((i & 1) == 0) { hash ^= ((hash << 7) ^ c ^ (hash >> 3)); } else { hash ^= (~((hash << 11) ^ c ^ (hash >> 5))); } i++; } return (hash & 0x7FFFFFFF); } } } ======================= File: Assets/Scripts/Graphics/Geometric/2D/ConvexPolygon2D.cs ======================= using System.Collections.Generic; using RayGraphics.Math; namespace RayGraphics.Geometric { /// <summary> /// 生成polygon /// </summary> public class ConvexPolygon2D { /// <summary> /// 获取凸多边形的索引。 /// </summary> /// <param name="listpt"></param> /// <returns></returns> public static List<int> GenerateConvexPolygonIndex(Double2[] listpt) { List<int> listIndex = new List<int>(); List<Double2> listPoint= GenerateConvexPolygon(listpt); if (listPoint == null || listPoint.Count == 0) return listIndex; foreach (Double2 pos in listPoint) { int index = GetIndex(pos, listpt); if (index!= -1) { listIndex.Add(index); } } return listIndex; } private static int GetIndex(Double2 pos, Double2[] listpt) { if (listpt == null || listpt.Length == 0) return -1; for (int i = 0; i < listpt.Length; i++) { if (listpt[i] == pos) return i; } return -1; } /// <summary> /// 获取凸包 /// </summary> /// <param name="listpt"></param> /// <returns></returns> public static List<Double2> GenerateConvexPolygon(Double2[] listpt) { if (listpt == null || listpt.Length == 0) return null; // 先生成aabb。 Double2 min = Double2.positiveInfinity; Double2 max = Double2.negativeInfinity; foreach (Double2 pos in listpt) { min = Double2.Min(min, pos); max = Double2.Max(max, pos); } // 收集条边上的点,按顺时针收集。lb放置在bottom边上,rb 放置在right边上,ru顶点放置up边上, lu顶点放置在left边上 Double2[][] edgePointArray = new Double2[4][]; for (int i = 0; i < 4; i++) { edgePointArray[i] = new Double2[2]; if (i < 2) { edgePointArray[i][0] = Double2.positiveInfinity; edgePointArray[i][1] = Double2.negativeInfinity; } else { edgePointArray[i][0] = Double2.negativeInfinity; edgePointArray[i][1] = Double2.positiveInfinity; } } // 不在边上的顶点 List<Double2> listOutEdgePoint = new List<Double2>(); // 进行收集了。 foreach (Double2 pos in listpt) { bool isInedge = false; // 第一条边 bottom edge if (pos.y == min.y) { edgePointArray[0][0] = Double2.Min(pos, edgePointArray[0][0]); edgePointArray[0][1] = Double2.Max(pos, edgePointArray[0][1]); isInedge = true; } if (pos.x == max.x) // right edge { edgePointArray[1][0] = Double2.Min(pos, edgePointArray[1][0]); edgePointArray[1][1] = Double2.Max(pos, edgePointArray[1][1]); isInedge = true; } if(pos.y == max.y ) // up edge { edgePointArray[2][0] = Double2.Max(pos, edgePointArray[2][0]); edgePointArray[2][1] = Double2.Min(pos, edgePointArray[2][1]); isInedge = true; } if(pos.x == min.x) // left edge { edgePointArray[3][0] = Double2.Max(pos, edgePointArray[3][0]); edgePointArray[3][1] = Double2.Min(pos, edgePointArray[3][1]); isInedge = true; } if(isInedge == false) { listOutEdgePoint.Add(pos); } } // 边上的顶点按顺时针排序了。 // List<Double2> listPoly = new List<Double2>(); Double2 startPoint ; Double2 endPoint = Double2.negativeInfinity; for (int i = 0; i < 4; i++) { startPoint = edgePointArray[i][0]; if (startPoint!= endPoint) { listPoly.Add(startPoint); } endPoint = edgePointArray[i][1]; if (startPoint!= endPoint) { listPoly.Add(endPoint); } if (endPoint!= edgePointArray[(i + 1) % 4][0]) { List<Double2> llinkPoint = SearchOutPoint(i, endPoint, edgePointArray[(i + 1) % 4][0], listOutEdgePoint); if (llinkPoint!= null && llinkPoint.Count > 0) { listPoly.AddRange(llinkPoint); } } } for (int i = 0; i < 4; i++) { edgePointArray[i] = null; } edgePointArray = null; if (listPoly.Count > 1) { if (listPoly[0] == listPoly[listPoly.Count - 1]) { listPoly.RemoveAt(listPoly.Count - 1); } } return listPoly; } /// <summary> /// 获取最边缘一圈的顶点。 /// </summary> /// <param name="dir"></param> /// <param name="s"></param> /// <param name="e"></param> /// <param name="listOutEdgePoint"></param> /// <returns></returns> private static List<Double2> SearchOutPoint(int edgeIndex, Double2 s, Double2 e, List<Double2> listOutEdgePoint) { if (listOutEdgePoint == null || listOutEdgePoint.Count == 0) return null; Double2 outdir; Double2 indir; if (edgeIndex == 0) { if (s.y == e.y) return null; outdir = Double2.right; indir = (e - s).normalized; } else if (edgeIndex == 1) { if (s.x == e.x) return null; outdir = Double2.up; indir = (e - s).normalized; } else if (edgeIndex == 2) { if (s.y == e.y) return null; outdir = Double2.left; indir = (e - s).normalized; } else if (edgeIndex == 3) { if (s.x == e.x) return null; outdir = Double2.down; indir = (e - s).normalized; } else return null; // 开始搜寻了。 List<Double2> lResult = new List<Double2>(); Double2 startPoint = s; Double2 bestPoint = Double2.zero; bool isHaveBestPoint = false; List<Double2> listinPoints = new List<Double2>(); List<Double2> lHave = listOutEdgePoint; while (lHave!= null && lHave.Count > 0) { // 先过滤了。 foreach (Double2 pos in lHave) { if (Double2.CheckPointInCorns(pos, startPoint, indir, outdir) == true) { listinPoints.Add(pos); if (isHaveBestPoint == false) { bestPoint = pos; isHaveBestPoint = true; } } } // 再则优。 if (isHaveBestPoint == true) { for (int i = 1; i < listinPoints.Count; i++) { // 比较更好的点。 if (Double2.CheckPointInCorns(listinPoints[i], startPoint, (bestPoint - startPoint).normalized, outdir) == true) { bestPoint = listinPoints[i]; } } // 进行交换,执行下一轮迭代。 lResult.Add(bestPoint); startPoint = bestPoint; indir = (e - startPoint).normalized; listinPoints.Remove(bestPoint); lHave = listinPoints; listinPoints = new List<Double2>(); isHaveBestPoint = false; } else break; } return lResult; } } } ======================= File: Assets/Scripts/Graphics/bounding/IBounding.cs ======================= using System.Collections.Generic; using RayGraphics.Math; /// <summary> /// 包围盒 /// </summary> namespace RayGraphics.Bounding { public interface IBounding { // Start is called before the first frame update void Generate(List<Float3> listPt); void Generate(Float3[] ptArray); #if Client void Generate(UnityEngine.Mesh mesh); #endif bool CheckIN(); } } ======================= File: Assets/Scripts/Graphics/Geometric/Set/PolygonBool.cs ======================= using System.Collections.Generic; using RayGraphics.Math; /// <summary> /// polygon bool 运算的基础函数 /// </summary> namespace RayGraphics.Geometric { public class PolygonBool { /// <summary> /// 清理动作 /// </summary> /// <param name="Poly1IntersectArray"></param> /// <param name="Poly2IntersectArray"></param> public static void ClearPolyIntersectArray(ref List<Double3>[] Poly1IntersectArray, ref List<Double3>[] Poly2IntersectArray) { if (Poly1IntersectArray!= null) { foreach (List<Double3> v in Poly1IntersectArray) { if (v!= null && v.Count > 0) { v.Clear(); } } Poly1IntersectArray = null; } if (Poly2IntersectArray!= null) { foreach (List<Double3> v in Poly2IntersectArray) { if (v!= null && v.Count > 0) { v.Clear(); } } Poly2IntersectArray = null; } } /// <summary> /// 获取另外一个多边形的边 /// </summary> /// <param name="poly"></param> /// <param name="poly1"></param> /// <param name="poly2"></param> /// <param name="edgeIndex"></param> /// <returns></returns> public static Point2D GetOtherEdge(Polygon2D poly, Polygon2D poly1, Polygon2D poly2, int edgeIndex) { if (poly == poly1) { return poly2.GetSimpleEdge(edgeIndex); } else return poly1.GetSimpleEdge(edgeIndex); } /// <summary> /// 加入顶点 /// </summary> /// <param name="listPoint"></param> /// <param name="point"></param> /// <returns></returns> public static bool AddPoint(List<Double2> listPoint, Double2 point) { if (listPoint.Count > 300) return false; if (listPoint.Count > 0 && listPoint[0] == point) { return false; } else { listPoint.Add(point); return true; } /*if (listPoint.Contains(point) == true) return false; else { listPoint.Add(point); return true; }*/ } /// <summary> /// 主多边形上找到一个顶点,不在diff多边形内的。 /// </summary> /// <param name="mainPoly"></param> /// <param name="diffpoly"></param> /// <param name="poly"></param> /// <param name="curedge"></param> public static bool FindOutDiffPointPoint(Polygon2D mainPoly, Polygon2D diffpoly, ref Double2 curPoint, ref int curedge) { if (mainPoly == null || diffpoly == null || mainPoly.GetEdgeNum() < 3 || diffpoly.GetEdgeNum() < 3) return false; for (int i = 0; i < mainPoly.GetEdgeNum(); i++) { Double2 point = mainPoly.GetPoint(i); if (diffpoly.CheckIn(point) == false) { curPoint = point; curedge = i; return true; } } return false; } /// <summary> /// 交换数据 /// </summary> /// <param name="poly"></param> /// <param name="poly1"></param> /// <param name="poly2"></param> public static void ExChangePoly(ref Polygon2D poly, Polygon2D poly1, Polygon2D poly2, ref List<Double3>[] curPolyIntersectArray, List<Double3>[] poly1IntersectArray, List<Double3>[] poly2IntersectArray) { if (poly == poly1) { poly = poly2; } else poly = poly1; if (curPolyIntersectArray == poly1IntersectArray) { curPolyIntersectArray = poly2IntersectArray; } else curPolyIntersectArray = poly1IntersectArray; } /// <summary> /// 获取多边形所有边的相交点 /// </summary> /// <param name="mainPoly"></param> /// <param name="diffpoly"></param> /// <param name="mainPolyIntersectArray"></param> /// <param name="Poly2IntersectArray"></param> public static void GetAllEdgeInterSectPoint(Polygon2D mainPoly, Polygon2D diffpoly, ref List<Double3>[] mainPolyIntersectArray, ref List<Double3>[] Poly2IntersectArray) { if (mainPoly == null || diffpoly == null) return; for (int i = 0; i < mainPoly.GetEdgeNum(); i++) { diffpoly.GetAllIntersectPoint(mainPoly.GetEdge(i), ref mainPolyIntersectArray[i]); } // for (int i = 0; i < diffpoly.GetEdgeNum(); i++) { mainPoly.GetAllIntersectPoint(diffpoly.GetEdge(i), ref Poly2IntersectArray[i]); } } /// <summary> /// 多边形决策。 /// </summary> /// <param name="ls2d"></param> /// <param name="targetPoint"></param> /// <param name="middlePoint"></param> public static bool GetNearPointInEdge(Polygon2D poly, Polygon2D mainPoly_, Polygon2D diffPoly_, Point2D ls2d, Double2 curPoint, List<Double3> listMiddlePoint, ref Double3 nextPoint) { if (listMiddlePoint == null || listMiddlePoint.Count == 0) { return false; } else { int k = 0; if (curPoint!= ls2d.startPoint) { for (int i = listMiddlePoint.Count - 1; i >= 0; i--) { // 找到了 Double2 temp = new Double2(listMiddlePoint[i].x, listMiddlePoint[i].y); Double2 diff = curPoint - temp; bool ret = System.Math.Abs(diff.x) <= MathUtil.kEpsilon && System.Math.Abs(diff.y) <= MathUtil.kEpsilon; if (ret == true) { if (i < listMiddlePoint.Count - 1) { k = i + 1; break; } else { return false; } } } } else { // 过重复点 while (k < listMiddlePoint.Count - 1 && (listMiddlePoint[k].x == listMiddlePoint[k + 1].x && listMiddlePoint[k].y == listMiddlePoint[k + 1].y)) { k++; } } Point2D otherEdge = PolygonBool.GetOtherEdge(poly, mainPoly_, diffPoly_, (int)listMiddlePoint[k].z); if (Double2.Cross(ls2d.endPoint - ls2d.startPoint, otherEdge.endPoint - otherEdge.startPoint) == 0 && k < listMiddlePoint.Count - 1) { k++; } // nextPoint = listMiddlePoint[k]; if (curPoint == new Double2(nextPoint.x, nextPoint.y)) return false; return true; } } } } ======================= File: Assets/Scripts/Graphics/Triangulation2D/VertexInfo.cs ======================= <gh_stars>0 using RayGraphics.Math; namespace RayGraphics.Triangulation { /// <summary> /// 顶点信息 /// </summary> public class VertexInfo { /// <summary> /// 顶点数据 /// </summary> public Float2 pos; /// <summary> /// 所在顶点列表中的索引 /// </summary> public int fixIndex; /// <summary> /// 在多边形链的序列 /// </summary> public int indexInPolygonChain; /// <summary> /// 在多边形中是否为凸点 /// </summary> public bool isConvex; /// <summary> /// 是否为歧点 /// </summary> public VertexType vType; /// <summary> /// 确定是否歧点,分割点 /// </summary> /// <param name="isYdown"></param> /// <returns></returns> public bool CheckSplitPoint(bool isYdown) { if (this.isConvex == true) return false; if (this.vType == VertexType.UpCorner && isYdown == true) { return true; } else if (this.vType == VertexType.DownCorner && isYdown == false) { return true; } return false; } /// <summary> /// 获取左边 /// </summary> /// <returns></returns> public virtual Edge GetLeftEdge(PolygonChain parent) { VertexInfo prev = parent.GetVertexInfo(this.indexInPolygonChain - 1); VertexInfo next = parent.GetVertexInfo(this.indexInPolygonChain + 1); if (prev.pos.x <= this.pos.x) { return new Edge(this, prev); } else { return new Edge(this, next); } } /// <summary> /// 获取右边 /// </summary> /// <returns></returns> public virtual Edge GetRightEdge(PolygonChain parent) { VertexInfo prev = parent.GetVertexInfo(this.indexInPolygonChain - 1); VertexInfo next = parent.GetVertexInfo(this.indexInPolygonChain + 1); if (prev.pos.x >= this.pos.x) { return new Edge(this, prev); } else { return new Edge(this, next); } } /// <summary> /// 获取左点 /// </summary> /// <returns></returns> public virtual VertexInfo GetLeftPoint() { return this; } /// <summary> /// 获取右点 /// </summary> /// <returns></returns> public virtual VertexInfo GetRightPoint() { return this; } /// <summary> /// 是否hit。 /// </summary> /// <param name="ScanPoints">扫描线点,可能为符合点</param> /// <returns></returns> public bool CheckHit(VertexInfo ScanPoints) { if (this == ScanPoints.GetLeftPoint() || this == ScanPoints.GetRightPoint()) return true; else return false; } /// <summary> /// 对边进行成长 /// </summary> /// <param name="growEdge"></param> /// <returns></returns> public virtual Edge GetGrowEdge(Edge growEdge, ref VertexInfo helper, PolygonChain parent) { helper = growEdge.end; return new Edge(growEdge.end, parent.GetOtherPoints(growEdge)); } } /// <summary> /// 组合点,满足条件,y值相同,在同一条边上,凹凸性相同 /// </summary> public class CombineVertex : VertexInfo { private VertexInfo left; private VertexInfo right; /// <summary> /// 使用左顶点代替组合顶点数据 /// </summary> /// <param name="left"></param> /// <param name="right"></param> public CombineVertex(VertexInfo left, VertexInfo right) { this.left = left; this.right = right; this.pos = this.left.pos; this.vType = this.left.vType; this.isConvex = this.left.isConvex; this.fixIndex = this.left.fixIndex; this.indexInPolygonChain = this.left.indexInPolygonChain; } /// <summary> /// 确定2个点能否合并 /// </summary> /// <param name="left"></param> /// <param name="right"></param> /// <returns></returns> public static bool CheckCanCombine(VertexInfo left, VertexInfo right, PolygonChain parent) { if (left == null || right == null || parent == null) return false; if (left.pos.y!= right.pos.y) return false; if (parent.CheckSameEdge(left.indexInPolygonChain, right.indexInPolygonChain) == false) { return false; } return true; } /// <summary> /// 获取左边 /// </summary> /// <returns></returns> public override Edge GetLeftEdge(PolygonChain parent) { int leftIndex = this.left.indexInPolygonChain; VertexInfo prev = parent.GetVertexInfo(leftIndex - 1); VertexInfo next = parent.GetVertexInfo(leftIndex + 1); if (prev.pos.x <= this.left.pos.x) { return new Edge(this.left, prev); } else { return new Edge(this.left, next); } } /// <summary> /// 获取右边 /// </summary> /// <returns></returns> public override Edge GetRightEdge(PolygonChain parent) { int rightIndex = this.right.indexInPolygonChain; VertexInfo prev = parent.GetVertexInfo(rightIndex - 1); VertexInfo next = parent.GetVertexInfo(rightIndex + 1); if (prev.pos.x >= this.right.pos.x) { return new Edge(this.right, prev); } else { return new Edge(this.right, next); } } /// <summary> /// 获取左点 /// </summary> /// <returns></returns> public override VertexInfo GetLeftPoint() { return this.left; } /// <summary> /// 获取右点 /// </summary> /// <returns></returns> public override VertexInfo GetRightPoint() { return this.right; } /// <summary> /// 对边进行成长 /// </summary> /// <param name="growEdge"></param> /// <returns></returns> public override Edge GetGrowEdge(Edge growEdge, ref VertexInfo helper, PolygonChain parent) { if (growEdge.end == this.left) { helper = this.right; return new Edge(this.right, parent.GetOtherPoints(new Edge(this.left, this.right))); } else { helper = this.left; return new Edge(this.left, parent.GetOtherPoints(new Edge(this.right, this.left))); } } } public enum VertexType { Normal = 0, // 正常升,降 UpCorner = 1, // 向上拐 ^ DownCorner = 2, // 向下拐 } } ======================= File: Assets/Scripts/Voxelization/MapElement.cs ======================= using System.Collections.Generic; using RayGraphics.Math; namespace RayGraphics.Voxelization { [System.Serializable] public class MapElement { public virtual Float2 GetKeyPoint() { return Float2.zero; } /// <summary> /// 获取轮廓 /// </summary> /// <param name="grid"></param> /// <returns></returns> public virtual List<Double2> GetContourPoints(RLEGridMap grid, Float2 startSearchPoint) { List<Double2> listPoint = new List<Double2>(); Short2 ContourStartPoint = Short2.zero; Short2 ContourStartBlockPoint = Short2.zero; if (GetStartingPoint(ref ContourStartPoint, ref ContourStartBlockPoint, startSearchPoint, grid) == true) { List<Short2> list = MarchingSquares(ContourStartPoint, grid); foreach (Short2 v in list) { Double2 pos = new Double2(v.x, v.y) * grid.TileSize; listPoint.Add(pos); } // 轮廓挡格区域点。 不能这样清理哦。 grid.EmptyContinuousBlock(ContourStartBlockPoint); //Core.BlockTool.BlockTexureExport.SaveBlockTexture(2, grid); } return listPoint; } /// <summary> /// 获取轮廓起点及轮廓挡格起点 /// </summary> /// <param name="ContourStartPoint">轮廓起点</param> /// <param name="ContourStartBlockPoint">轮廓挡格起点</param> /// <param name="startSearchPoint">悬针搜索点</param> /// <param name="grid"></param> /// <returns></returns> public bool GetStartingPoint(ref Short2 ContourStartPoint, ref Short2 ContourStartBlockPoint, Float2 startSearchPoint, RLEGridMap grid) { Short2 center = grid.GetIndex(startSearchPoint); if (grid.CheckInMap(center) == false) return false; for (int j = 0; j <= center.y; j++) { if (grid.CheckBlock(center - new Short2(0, j)) == true) { ContourStartPoint = center - new Short2(0, j - 1); ContourStartBlockPoint = center - new Short2(0, j); return true; } } return false; } /// <summary> /// 使用移动cubes 获取轮廓线。Contour 轮廓 /// </summary> /// <returns></returns> public List<Short2> MarchingSquares(Short2 startPoint, RLEGridMap grid) { List<Short2> listPoint = new List<Short2>(); int pX = startPoint.x; int pY = startPoint.y; int stepX = 0; int stepY = 0; int prevX = 0; int prevY = 0; bool closedLoop = false; while (!closedLoop) { // the core of the script is getting the 2x2 square value of each pixel int squareValue = grid.GetSquareValue(pX, pY); switch (squareValue) { /* going UP with these cases: +---+---+ +---+---+ +---+---+ | 1 | | | 1 | | | 1 | | +---+---+ +---+---+ +---+---+ | | | | 4 | | | 4 | 8 | +---+---+ +---+---+ +---+---+ */ case 1: case 5: case 13: stepX = 0; stepY = -1; break; /* going DOWN with these cases: +---+---+ +---+---+ +---+---+ | | | | | 2 | | 1 | 2 | +---+---+ +---+---+ +---+---+ | | 8 | | | 8 | | | 8 | +---+---+ +---+---+ +---+---+ */ case 8: case 10: case 11: stepX = 0; stepY = 1; break; /* going LEFT with these cases: +---+---+ +---+---+ +---+---+ | | | | | | | | 2 | +---+---+ +---+---+ +---+---+ | 4 | | | 4 | 8 | | 4 | 8 | +---+---+ +---+---+ +---+---+ */ case 4: case 12: case 14: stepX = -1; stepY = 0; break; /* going RIGHT with these cases: +---+---+ +---+---+ +---+---+ | | 2 | | 1 | 2 | | 1 | 2 | +---+---+ +---+---+ +---+---+ | | | | | | | 4 | | +---+---+ +---+---+ +---+---+ */ case 2: case 3: case 7: stepX = 1; stepY = 0; break; case 6: /* special saddle point case 1: +---+---+ | | 2 | +---+---+ | 4 | | +---+---+ going LEFT if coming from UP else going RIGHT */ if (prevX == 0 && prevY == -1) { stepX = -1; stepY = 0; } else { stepX = 1; stepY = 0; } break; case 9: /* special saddle point case 2: +---+---+ | 1 | | +---+---+ | | 8 | +---+---+ going UP if coming from RIGHT else going DOWN */ if (prevX == 1 && prevY == 0) { stepX = 0; stepY = -1; } else { stepX = 0; stepY = 1; } break; } // moving onto next point pX += stepX; pY += stepY; // saving contour point listPoint.Add(new Short2(pX, pY)); prevX = stepX; prevY = stepY; // if we returned to the first point visited, the loop has finished if (pX == startPoint.x && pY == startPoint.y) { closedLoop = true; } } return listPoint; } } } ======================= File: Assets/Scripts/Graphics/Math/Index2.cs ======================= <reponame>741645596/graph namespace RayGraphics.Math { [System.Serializable] public struct Index2 { public int p1; public int p2; public Index2(int p1, int p2) { this.p1 = p1; this.p2 = p2; } public bool CheckContain(int index) { if (this.p1 == index || this.p2 == index) return true; else return false; } public static bool operator!=(Index2 v1, Index2 v2) { bool r1 = v1.CheckContain(v2.p1) && v1.CheckContain(v2.p2) ; bool r2 = v2.CheckContain(v1.p1) && v2.CheckContain(v1.p2) ; if (r1 && r2) return false; else return true; } public static bool operator ==(Index2 v1, Index2 v2) { bool r1 = v1.CheckContain(v2.p1) && v1.CheckContain(v2.p2); bool r2 = v2.CheckContain(v1.p1) && v2.CheckContain(v1.p2); return r1 && r2; } public override bool Equals(System.Object obj) { if (obj == null) { return false; } Index2 p = (Index2)obj; if ((System.Object)p == null) { return false; } bool r1 = this.CheckContain(p.p1) && this.CheckContain(p.p2) ; bool r2 = p.CheckContain(this.p1) && p.CheckContain(this.p2); return r1 && r2; } public override int GetHashCode() { return base.GetHashCode(); } } } ======================= File: Assets/Scripts/Action/show/GridLine.cs ======================= <filename>Assets/Scripts/Action/show/GridLine.cs using UnityEngine; using System.Collections; using RayGraphics.Geometric; using RayGraphics.Math; public class GridLine : MonoBehaviour { public Material material; public Rect2D rc2d; //public LineSegment2D ls2d; public LineSegment2D ls2d1; //public Float2 point; private Rays2D vectorAix; void Start() { rc2d = new Rect2D(Double2.zero, Double2.one * 10); //ls2d = new LineSegment2D(Float2.zero, new Float2(10, 0)); ls2d1 = new LineSegment2D(new Double2(-20, 5), new Double2(20, 5)); //InvokeRepeating("Doline", 0.1f, 1.0f); } void Doline() { //Float2 normalizedDir = Float2.Rotate(ls2d.normalizedDir, 0.1f); //ls2d = new LineSegment2D(ls2d.startPoint, ls2d.startPoint + normalizedDir * ls2d.length); //vectorAix = new Rays2D(ls2d.ProjectPoint(point), ls2d.AixsVector(point)); } // Update is called once per frame void Update() { } void OnRenderObject() { material.SetPass(0); GL.wireframe = false; GL.Color(Color.yellow); GL.PushMatrix(); GL.Begin(GL.LINES); //ls2d.Draw(); //vectorAix.Draw(); rc2d.Draw(); ls2d1.Draw(); GL.End(); GL.PopMatrix(); GL.wireframe = false; } void OnDrawGizmos() { //ls2d.DrawGizmos(); ls2d1.DrawGizmos(); rc2d.DrawGizmos(); //point.DrawGizmos(); //ls2d.ProjectPoint(point).DrawGizmos(); //ls2d.GetMirrorPoint(point).DrawGizmos(); /*Float2 interPoint = Float2.zero; if (ls2d.GetIntersectPoint(ls2d1, ref interPoint) == true) { interPoint.DrawGizmos(); }*/ } } ======================= File: Assets/Scripts/Action/show/wayPointShow.cs ======================= using System.Collections.Generic; using UnityEngine; public class wayPointShow : MonoBehaviour { public Material material; public Vector3 offsetUp = Vector3.up; public bool showDetail = false; void OnRenderObject() { material.SetPass(0); GL.wireframe = false; GL.Color(Color.blue); GL.PushMatrix(); GL.Begin(GL.LINES); // GL.End(); GL.PopMatrix(); GL.wireframe = false; } } ======================= File: Assets/Scripts/Graphics/Math/Float2.cs ======================= <filename>Assets/Scripts/Graphics/Math/Float2.cs<gh_stars>0 /// <summary> /// 平面向量 /// </summary> namespace RayGraphics.Math { [System.Serializable] public partial struct Float2 { public float x, y; public Float2(float x, float y) { this.x = x; this.y = y; } public Float2(double x, double y) { this.x = (float)x; this.y = (float)y; } /// <summary> /// 设置属性 /// </summary> /// <param name="x"></param> /// <param name="y"></param> public void Set(float x, float y) { this.x = x; this.y = y; } /// <summary> /// 按索引访问 /// </summary> /// <param name="index"></param> /// <returns></returns> public float this[int index] { get { if (index == 0) return this.x; else if (index == 1) return this.y; else return 0; } set { if (index == 0) this.x = value; else if (index == 1) this.y = value; } } /// <summary> /// 模的平方 /// </summary> public float sqrMagnitude { get { return this.x * this.x + this.y * this.y; } } /// <summary> /// 模 /// </summary> public float magnitude { get { return (float)System.Math.Sqrt(this.sqrMagnitude); } } /// <summary> /// 单位向量 /// </summary> public Float2 normalized { get { float length = this.magnitude; if (length == 0) { return new Float2(x, y); } else { length = 1 / length; return new Float2(x * length, y * length); } } } /// <summary> /// 0 向量 /// </summary> public static Float2 zero { get { return s_zero; } } private static readonly Float2 s_zero = new Float2(0, 0); /// <summary> /// 单位向量 /// </summary> public static Float2 one { get { return s_one; } } private static readonly Float2 s_one = new Float2(1, 1); /// <summary> /// back 向量 /// </summary> public static Float2 down { get { return s_down; } } private static readonly Float2 s_down = new Float2(0, -1); /// <summary> /// foward 向量 /// </summary> public static Float2 up { get { return s_up; } } private static readonly Float2 s_up = new Float2(0, 1); /// <summary> /// foward 向量 /// </summary> public static Float2 left { get { return s_left; } } private static readonly Float2 s_left = new Float2(-1, 0); /// <summary> /// foward 向量 /// </summary> public static Float2 right { get { return s_right; } } private static readonly Float2 s_right = new Float2(1, 0); /// <summary> /// 负无穷大 /// </summary> public static Float2 negativeInfinity { get { return s_negativeInfinity; } } private static readonly Float2 s_negativeInfinity = new Float2(float.NegativeInfinity, float.NegativeInfinity); /// <summary> /// 无穷大 /// </summary> public static Float2 positiveInfinity { get { return s_positiveInfinity; } } private static readonly Float2 s_positiveInfinity = new Float2(float.PositiveInfinity, float.PositiveInfinity); public static bool operator!=(Float2 v1, Float2 v2) { return v1.x!= v2.x || v1.y!= v2.y; } public static bool operator ==(Float2 v1, Float2 v2) { return v1.x == v2.x && v1.y == v2.y; } /// <summary> /// > 运算符 /// </summary> /// <param name="v1"></param> /// <param name="v2"></param> /// <returns></returns> public static bool operator >(Float2 v1, Float2 v2) { return v1.x > v2.x && v1.y > v2.y; } /// <summary> /// < 运算符 /// </summary> /// <param name="v1"></param> /// <param name="v2"></param> /// <returns></returns> public static bool operator <(Float2 v1, Float2 v2) { return v1.x < v2.x && v1.y < v2.y; } /// <summary> /// >= 运算符 /// </summary> /// <param name="v1"></param> /// <param name="v2"></param> /// <returns></returns> public static bool operator >=(Float2 v1, Float2 v2) { return v1.x >= v2.x && v1.y >= v2.y; } /// <summary> /// <= 运算符 /// </summary> /// <param name="v1"></param> /// <param name="v2"></param> /// <returns></returns> public static bool operator <=(Float2 v1, Float2 v2) { return v1.x <= v2.x && v1.y <= v2.y ; } public static Float2 operator +(Float2 v1, Float2 v2) { float xx = v1.x + v2.x; float yy = v1.y + v2.y; return new Float2(xx, yy); } public static Float2 operator -(Float2 v1, Float2 v2) { float xx = v1.x - v2.x; float yy = v1.y - v2.y; return new Float2(xx, yy); } /// <summary> /// 负号重载 /// </summary> /// <param name="v1"></param> /// <returns></returns> public static Float2 operator -(Float2 v1) { float xx = -v1.x; float yy = -v1.y; return new Float2(xx, yy); } /// <summary> /// * 运算 /// </summary> /// <param name="k"></param> /// <param name="vector"></param> /// <returns></returns> public static Float2 operator *(float k, Float2 v) { float xx = v.x * k; float yy = v.y * k; return new Float2(xx, yy); } /// <summary> /// * 运算 /// </summary> /// <param name="vector"></param> /// <param name="k"></param> /// <returns></returns> public static Float2 operator *(Float2 v, float k) { float xx = v.x * k; float yy = v.y * k; return new Float2(xx, yy); } /// <summary> /// /运算 /// </summary> /// <param name="v"></param> /// <param name="k"></param> /// <returns></returns> public static Float2 operator /(Float2 v, float k) { if (k!= 0) { k = 1 / k; } else { k = 1; } return v * k; } public override bool Equals(System.Object obj) { if (obj == null) { return false; } Float2 p = (Float2)obj; if ((System.Object)p == null) { return false; } return (x == p.x) && (y == p.y); } public override int GetHashCode() { return base.GetHashCode(); } /// <summary> /// 夹角[0, PI] /// </summary> /// <param name="a"></param> /// <param name="b"></param> /// <returns></returns> public static float Angle(Float2 from, Float2 to) { float cosAngle = CosAngle(from, to); return (float)System.Math.Acos(cosAngle); } /// <summary> /// 求cos Angle /// </summary> /// <param name="a"></param> /// <param name="b"></param> /// <returns></returns> public static float CosAngle(Float2 from, Float2 to) { float dot = Dot(from, to); double sqrDot = (dot * dot) / (from.sqrMagnitude * to.sqrMagnitude); if (dot > 0) { dot = (float)System.Math.Sqrt(sqrDot); dot = System.Math.Min(dot, 1.0f); } else { dot = -(float)System.Math.Sqrt(sqrDot); dot = System.Math.Max(dot, -1.0f); } return dot; } /// <summary> /// 求sin Angle /// </summary> /// <param name="a"></param> /// <param name="b"></param> /// <returns></returns> public static float SinAngle(Float2 from, Float2 to) { float cross = Cross(from, to); double sqrCross = (cross * cross) / (from.sqrMagnitude * to.sqrMagnitude); if (cross > 0) { cross = (float)System.Math.Sqrt(sqrCross); cross = System.Math.Min(cross, 1.0f); } else { cross = -(float)System.Math.Sqrt(sqrCross); cross = System.Math.Max(cross, -1.0f); } return cross; } /// <summary> /// 向量组成的平行四边形的面积, 已经取绝对值。 /// </summary> /// <param name="from"></param> /// <param name="to"></param> /// <returns></returns> public static float Area(Float2 from, Float2 to) { return System.Math.Abs(Float2.Cross(from, to)); } /// <summary> /// 共线判断,考虑误差 /// </summary> /// <param name="a"></param> /// <param name="b"></param> /// <returns></returns> public static bool CheckInLine(Float2 a, Float2 b) { return System.Math.Abs(Float2.Cross(a, b)) < MathUtil.kEpsilon? true : false; } /// <summary> /// 垂直判断,考虑误差 /// </summary> /// <param name="a"></param> /// <param name="b"></param> /// <returns></returns> public static bool CheckVertical(Float2 a, Float2 b) { return System.Math.Abs(Float2.Dot(a, b)) < MathUtil.kEpsilon? true : false; } /// <summary> /// 保持向量方向,调整向量长度 /// </summary> /// <param name="a"></param> /// <param name="b"></param> /// <returns></returns> public static Float2 ClampMagnitude(Float2 a, float maxLength) { return a.normalized * maxLength; } /// <summary> /// 点积 /// </summary> /// <param name="a"></param> /// <param name="b"></param> /// <returns></returns> public static float Dot(Float2 a, Float2 b) //点积 { return a.x * b.x + a.y * b.y; } /// <summary> /// 叉积, 可通过float3 的cross 推出,结果实际上就是z分量的值,因为,x,y分量都为0 /// </summary> /// <param name="a"></param> /// <param name="b"></param> /// <returns></returns> public static float Cross(Float2 a, Float2 b) { return a.x * b.y - a.y * b.x; } /// <summary> /// 求距离 /// </summary> /// <param name="start"></param> /// <param name="end"></param> /// <returns></returns> public static double Distance(Float2 start, Float2 end) { return (start - end).magnitude; } /// <summary> /// 限制性在点start,end 之间插值Linearly interpolates between two points. /// </summary> /// <param name="start"></param> /// <param name="end"></param> /// <param name="t">[0,1]</param> /// <returns></returns> public static Float2 Lerp(Float2 start, Float2 end, float t) { t = t < 0? 0 : t; t = t > 1? 1 : t; return start + (end - start) * t; } /// <summary> /// 非限制性在点start,end 之间插值Linearly interpolates between two points. /// </summary> /// <param name="start"></param> /// <param name="end"></param> /// <param name="t"></param> /// <returns></returns> public static Float2 LerpUnclamped(Float2 start, Float2 end, float t) { return start + (end - start) * t; } /// <summary> /// 获取max向量,计算包围盒有用 /// </summary> /// <param name="a"></param> /// <param name="b"></param> /// <returns></returns> public static Float2 Max(Float2 a, Float2 b) { return new Float2(System.Math.Max(a.x, b.x), System.Math.Max(a.y, b.y)); } /// <summary> /// 获取Min向量,计算包围盒有用 /// </summary> /// <param name="a"></param> /// <param name="b"></param> /// <returns></returns> public static Float2 Min(Float2 a, Float2 b) { return new Float2(System.Math.Min(a.x, b.x), System.Math.Min(a.y, b.y)); } /// <summary> /// 朝目标向量移动maxDistanceDelta距离,未考虑移出。 /// </summary> /// <param name="current"></param> /// <param name="target"></param> /// <param name="maxDistanceDelta"></param> /// <returns></returns> public static Float2 MoveTowards(Float2 current, Float2 target, float maxDistanceDelta) { return current + (target - current).normalized * maxDistanceDelta; } /// <summary> /// vector 在 onNormal的投影 /// </summary> /// <param name="vector"></param> /// <param name="onNormal"></param> /// <returns></returns> public static Float2 Project(Float2 vector, Float2 onNormal) { Float2 normal = onNormal.normalized; return Dot(vector, normal) * normal; } /// <summary> /// 返回逆时针旋转90度的向量 /// </summary> /// <param name="inDirection"></param> /// <returns></returns> public static Float2 Perpendicular(Float2 inDirection) { Double2 ret = Matrix2x2.RotateMatrix(MathUtil.kPI / 2) * new Double2(inDirection.x, inDirection.y); return new Float2(ret.x, ret.y); } /// <summary> /// 求发射光线 /// </summary> /// <param name="inDirection">入射光线</param> /// <param name="inNormal">法线</param> /// <returns></returns> public static Float2 Reflect(Float2 inDirection, Float2 inNormal) { return inDirection - Float2.Project(inDirection, inNormal) * 2; } /// <summary> /// 分量分别相乘,得到新的向量 /// </summary> /// <param name="a"></param> /// <param name="b"></param> /// <returns></returns> public static Float2 Scale(Float2 a, Float2 b) { return new Float2(a.x * b.x, a.y * b.y); } /// <summary> /// 向量旋转 /// </summary> /// <param name="angle"></param> /// <returns></returns> public static Float2 Rotate(Float2 a, double angle) { Double2 ret = Matrix2x2.RotateMatrix(angle) * new Double2(a.x, a.y); return new Float2(ret.x, ret.y); } /// <summary> /// 求角度,逆时针为正, 瞬时值为负。 /// </summary> /// <param name="from"></param> /// <param name="to"></param> /// <returns></returns> public static float SignedAngle(Float2 from, Float2 to) { // [-PI / 2, PI /2] Asin // [0, PI] acos double sinValue = SinAngle(from, to); double dot = Dot(from, to); double sqrDot = (dot * dot) / (from.sqrMagnitude * to.sqrMagnitude); if (dot > 0) { dot = System.Math.Sqrt(sqrDot); dot = System.Math.Min(dot, 1.0f); } else { dot = -System.Math.Sqrt(sqrDot); dot = System.Math.Max(dot, -1.0f); } if (sinValue == 0) // 共线 { return dot >= 0? 0 : MathUtil.kPI; } else if (sinValue > 0) { if (dot >= 0) // 1 { return (float)(System.Math.Asin(sinValue)); } else // 2 { return (float)(System.Math.Acos(dot)); } } else { if ( dot >= 0) // 4 { return (float)(System.Math.Asin(sinValue)); } else // 3 { return -(float)(System.Math.Acos(dot)); } } } public static Float2 SmoothDamp(Float2 current, Float2 target, ref Float2 currentVelocity, float smoothTime, float maxSpeed, float deltaTime) { return Float2.zero; } /// <summary> /// 判断目标点,在夹角内, /// </summary> /// <param name="target">目标点</param> /// <param name="startPoint">起点</param> /// <param name="indir">起点出发的2个边界向量</param> /// <param name="outdir">起点出发的2个边界向量</param> /// <returns></returns> public static bool CheckPointInCorns(Float2 target, Float2 startPoint, Float2 indir, Float2 outdir) { Float2 diff = target - startPoint; if (diff == Float2.zero) return false; float ret = Float2.Cross(outdir, diff) * Float2.Cross(indir.normalized, diff); if (ret < 0) { Float2 mid = indir.normalized + outdir.normalized; // 添加异常处理,防止在反方向 if (Float2.Dot(diff, mid) < 0) return false; else return true; } else if (ret == 0) { if (Float2.Dot(diff, indir) <= 0) return false; if (indir.sqrMagnitude < diff.sqrMagnitude) return true; else return false; } return false; } /// <summary> /// 当点target位于线p1p2的左侧时为负 /// </summary> /// <param name="p1"></param> /// <param name="p2"></param> /// <param name="target">目标点</param> /// <returns></returns> public static float LeftOf(Float2 p1, Float2 p2, Float2 target) { return Cross(target - p1, p2 - p1); } #if Client /// <summary> /// 转vector2 /// </summary> public UnityEngine.Vector3 V2 { get { return new UnityEngine.Vector2(this.x, this.y); } } /// <summary> /// 转vector3 /// </summary> public UnityEngine.Vector3 V3 { get { return new UnityEngine.Vector3(this.x, this.y, 0); } } /// <summary> /// 序列化 /// </summary> /// <returns></returns> public string toString() { return "x:" + x + "y:" + y; } /// <summary> /// DrawGizmos /// </summary> public void DrawGizmos() { UnityEngine.Gizmos.color = UnityEngine.Color.red; UnityEngine.Gizmos.DrawSphere(this.V3, 0.1f); } #endif } } ======================= File: Assets/Scripts/Graphics/Geometric/2D/AABB2D.cs ======================= using RayGraphics.Math; using System.Collections.Generic; namespace RayGraphics.Geometric { public class AABB2D { /// <summary> /// 左下 /// </summary> public Double2 leftBottom; /// <summary> /// 右上 /// </summary> public Double2 rightUp; /// <summary> /// 左⬆️ /// </summary> public Double2 LeftUp { get { return new Double2(leftBottom.x, rightUp.y); } } /// <summary> /// 右⬇️ /// </summary> public Double2 RightBottom { get { return new Double2(rightUp.x, leftBottom.y); } } /// <summary> /// Center /// </summary> public Double2 Center { get { return (this.leftBottom + this.rightUp) * 0.5f; } } /// <summary> /// 2* Center /// </summary> public Double2 Center2 { get { return this.leftBottom + this.rightUp; } } /// <summary> /// 设置aabb /// </summary> /// <param name="lb"></param> /// <param name="ru"></param> protected void SetAABB(Double2 lb, Double2 ru) { this.leftBottom = Double2.Min(lb, ru); this.rightUp = Double2.Max(lb, ru); } #if Client /// <summary> /// draw, 逆时针绘制 /// </summary> public void Draw() { UnityEngine.GL.Vertex(this.leftBottom.V3); UnityEngine.GL.Vertex(this.RightBottom.V3); // UnityEngine.GL.Vertex(this.RightBottom.V3); UnityEngine.GL.Vertex(this.rightUp.V3); // UnityEngine.GL.Vertex(this.rightUp.V3); UnityEngine.GL.Vertex(this.LeftUp.V3); // UnityEngine.GL.Vertex(this.LeftUp.V3); UnityEngine.GL.Vertex(this.leftBottom.V3); } /// <summary> /// DrawGizmos /// </summary> public void DrawGizmos() { leftBottom.DrawGizmos(); rightUp.DrawGizmos(); LeftUp.DrawGizmos(); RightBottom.DrawGizmos(); } #endif /// <summary> /// 判断点是否在直线上 /// </summary> /// <param name="pt"></param> /// <returns></returns> public virtual bool CheckIn(Double2 pt) { Double2 max = this.rightUp; if (pt.x > max.x || pt.y > max.y) return false; Double2 min = this.leftBottom; if (pt.x < min.x || pt.y < min.y) return false; return true; } /// <summary> /// 与直线的关系 /// </summary> /// <param name="line"></param> /// <returns></returns> public virtual LineRelation CheckLineRelation(Line2D line) { if (CheckIn(line.startPoint) == true) return LineRelation.Intersect; else // 4个点在同侧 { Double2 p1 = this.leftBottom - line.startPoint; Double2 p2 = this.RightBottom - line.startPoint; double cross1 = Double2.Cross(line.normalizedDir, p1); if (cross1 * Double2.Cross(line.normalizedDir, p2) <= 0) { return LineRelation.Intersect; } Double2 p3 = this.rightUp - line.startPoint; if (cross1 * Double2.Cross(line.normalizedDir, p3) <= 0) { return LineRelation.Intersect; } Double2 p4 = this.LeftUp - line.startPoint; if (cross1 * Double2.Cross(line.normalizedDir, p4) <= 0) { return LineRelation.Intersect; } return LineRelation.Detach; } } /// <summary> /// 射线间的关系 /// </summary> /// <param name="line"></param> /// <returns></returns> public virtual LineRelation CheckLineRelation(Rays2D line) { return LineRelation.Intersect; } /// <summary> /// 与线段的关系 /// </summary> /// <param name="line"></param> /// <returns></returns> public virtual LineRelation CheckLineRelation(LineSegment2D line) { return LineRelation.Intersect; } /// <summary> /// 最短射线包围盒路径 /// </summary> /// <param name="line">线段</param> /// <param name="offset">偏移值</param> /// <param name="rbi">包围盒信息</param> /// <returns>true,表示线段与aabb有相交,并返回最短包围路径</returns> public virtual RBIResultType RayboundingNearestPath(LineSegment2D line, double offset, ref RayboundingInfo rbi) { return RBIResultType.Fail; } /// <summary> /// 获取挡格附近出生点 /// </summary> /// <param name="line"></param> /// <param name="offset"></param> /// <param name="bornPoint"></param> /// <returns></returns> public virtual bool GetBornPoint(LineSegment2D line, double offset, ref Double2 bornPoint) { return false; } /// <summary> /// 获取交点 /// </summary> /// <param name="line"></param> /// <param name="intersectStart"></param> /// <param name="intersectEnd"></param> /// <returns></returns> public virtual bool GetIntersectPoint(LineSegment2D line, ref Double2 intersectStart, ref Double2 intersectEnd) { return false; } /// <summary> /// 获取近的相交点 /// </summary> /// <param name="line"></param> /// <param name="intersectStart"></param> /// <returns></returns> public virtual bool GetNearIntersectPoint(LineSegment2D line, ref Double2 intersectStart) { return false; } /// <summary> /// 与矩形的关系 /// </summary> /// <param name="dbd1"></param> /// <returns>true 相交: false 不相交</returns> public virtual bool CheckIntersect(Triangle2D ab) { return false; } /// <summary> /// 与矩形的关系 /// </summary> /// <param name="dbd1"></param> /// <returns>true 相交: false 不相交</returns> public virtual bool CheckIntersect(Rect2D ab) { return false; } /// <summary> /// 与圆的关系 /// </summary> /// <param name="dbd1"></param> /// <returns>true 相交: false 不相交</returns> public virtual bool CheckIntersect(Circle2D ab) { return false; } /// <summary> /// 与多边形的关系 /// </summary> /// <param name="dbd1"></param> /// <returns>true 相交: false 不相交</returns> public virtual bool CheckIntersect(Polygon2D ab) { return false; } /// <summary> /// 判断2个对象是否相交 /// </summary> /// <param name="ab1"></param> /// <param name="ab2"></param> /// <returns>暂处理不多边形的关系</returns> public static bool CheckIntersect(AABB2D ab1, AABB2D ab2) { if (ab1 == null || ab2 == null) return false; if (ab2 is Rect2D) return ab1.CheckIntersect(ab2 as Rect2D); else if (ab2 is Circle2D) return ab1.CheckIntersect(ab2 as Circle2D); else if(ab2 is Polygon2D) return ab1.CheckIntersect(ab2 as Polygon2D); return false; } /// <summary> /// 获取边 /// </summary> /// <param name="edgeIndex"></param> /// <returns></returns> public virtual LineSegment2D GetEdge(int edgeIndex) { if (edgeIndex == 0) { return new LineSegment2D(this.leftBottom, this.RightBottom); } else if (edgeIndex == 1) { return new LineSegment2D(this.RightBottom, this.rightUp); } else if (edgeIndex == 2) { return new LineSegment2D(this.rightUp, this.LeftUp); } else if (edgeIndex == 3) { return new LineSegment2D(this.LeftUp, this.leftBottom); } return new LineSegment2D(Double2.zero, Double2.zero); } /// <summary> /// 获取边 /// </summary> /// <param name="edgeIndex"></param> /// <returns></returns> public virtual Point2D GetSimpleEdge(int edgeIndex) { if (edgeIndex == 0) { return new Point2D(this.leftBottom, this.RightBottom); } else if (edgeIndex == 1) { return new Point2D(this.RightBottom, this.rightUp); } else if (edgeIndex == 2) { return new Point2D(this.rightUp, this.LeftUp); } else if (edgeIndex == 3) { return new Point2D(this.LeftUp, this.leftBottom); } return new Point2D(Double2.zero, Double2.zero); } /// <summary> /// 获取顶点 /// </summary> /// <param name="index"></param> /// <returns></returns> public virtual Double2 GetPoint(int index) { if (index == 0) { return this.leftBottom; } else if (index == 1) { return this.RightBottom; } else if (index == 2) { return this.rightUp; } else if (index == 3) { return this.LeftUp; } return Double2.zero; } /// <summary> /// 获取顶点 /// </summary> /// <param name="index"></param> /// <returns></returns> public virtual Double2Bool GetPointPlus(int index) { if (index == 0) { return new Double2Bool(this.leftBottom, true); } else if (index == 1) { return new Double2Bool(this.RightBottom, true); } else if (index == 2) { return new Double2Bool(this.rightUp, true); } else if (index == 3) { return new Double2Bool(this.LeftUp, true); } return new Double2Bool(Double2.zero, true); } /// <summary> /// 获取法线 /// </summary> /// <param name="edgeIndex"></param> /// <returns></returns> public virtual Double2 GetNormal(int edgeIndex) { if (edgeIndex == 0) { return Double2.down; } else if (edgeIndex == 1) { return Double2.right; } else if (edgeIndex == 2) { return Double2.up; } else if (edgeIndex == 3) { return Double2.left; } return Double2.zero; } /// <summary> /// 获取边数 /// </summary> /// <returns></returns> public virtual int GetEdgeNum() { return 4; } /// <summary> /// 获取顶点数组 /// </summary> /// <returns></returns> public virtual Double2[] GetPoints() { Double2[] points = new Double2[4]; points[0] = this.leftBottom; points[1] = this.RightBottom; points[2] = this.rightUp; points[3] = this.LeftUp; return points; } /// <summary> /// 获取顶点数组 /// </summary> /// <returns></returns> public virtual Double2Bool[] GetPointsPlus() { Double2Bool[] points = new Double2Bool[4]; points[0] = new Double2Bool(this.leftBottom, true); points[1] = new Double2Bool(this.RightBottom, true); points[2] = new Double2Bool(this.rightUp, true); points[3] = new Double2Bool(this.LeftUp, true); return points; } /// <summary> /// 判断某个顶点是否可通行 /// </summary> /// <param name="indexPoint"></param> /// <returns></returns> public virtual bool CheckCrossPoint(int indexPoint) { return true; } /// <summary> /// 获取顶点可通过数据 /// </summary> /// <returns></returns> public virtual HashSet<int> GetCrossPointData() { return null; } } } ======================= File: Assets/Scripts/Graphics/Geometric/3D/iGeo3DElement.cs ======================= using System.Collections; using System.Collections.Generic; using RayGraphics.Math; namespace RayGraphics.Geometric { public interface iGeo3DElement { /// <summary> /// 判断点是否在几何元素上 /// </summary> /// <param name="pt"></param> /// <returns></returns> bool CheckIn(Double3 pt); /// <summary> /// 点导几何元素的距离 /// </summary> /// <param name="pt"></param> /// <returns></returns> double CalcDistance(Double3 pt); /// <summary> /// 点导几何元素的投影点 /// </summary> /// <param name="pt"></param> /// <returns></returns> Double3 ProjectPoint(Double3 pt); /// <summary> /// 点到几何元素轴向量(垂直),交点-》pt /// </summary> /// <param name="pt"></param> /// <returns></returns> Double3 AixsVector(Double3 pt); /// <summary> /// 与线的关系 /// </summary> /// <param name="line"></param> /// <returns></returns> LineRelation CheckLineRelation(Line3D line); /// <summary> /// 获取交点 /// </summary> /// <param name="line"></param> /// <param name="intersectPoint"></param> /// <returns></returns> bool GetIntersectPoint(Line3D line, ref Double3 intersectPoint); } } ======================= File: Assets/Scripts/Graphics/Triangulation2D/PolygonChain.cs ======================= using RayGraphics.Math; using System.Collections.Generic; namespace RayGraphics.Triangulation { /// <summary> /// 多边形链 /// </summary> public class PolygonChain { /// <summary> /// 链的特点 /// </summary> private PolygonChainType m_Type; /// <summary> /// 顶点数量 /// </summary> private int countPonts; /// <summary> /// 顶点数量 /// </summary> public int CountPoints { get { return this.CountPoints; } } /// <summary> /// 对所用顶点进行按Y从低到高进行排序 /// </summary> private List<ScanLine> listScanLine = new List<ScanLine>(); /// <summary> /// 顶点列表 /// </summary> private List<VertexInfo> listPoints = new List<VertexInfo>(); /// <summary> /// 构建 /// </summary> /// <param name="minYIndex"></param> /// <param name="maxYIndex"></param> /// <param name="listPts"></param> public PolygonChain(List<VertexInfo> listPts) { int totalCount = listPts.Count; for (int i = 0; i < totalCount; i++) { VertexInfo v = listPts[i]; v.vType = VertexType.Normal; // 在多边形链中的索引 v.indexInPolygonChain = i; int prev = (i - 1) < 0? totalCount - 1 : (i - 1); int next = (i + 1) >= totalCount? 0 : (i + 1); v.vType = GetPointVertexType(listPts[prev], v, listPts[next]); SetPolygonChainType(v.vType); AddPoints(v); } CombineScanLine(); this.countPonts = listPoints.Count; } /// <summary> /// 设置多边形链的类型 /// </summary> /// <param name="type"></param> private void SetPolygonChainType(VertexType type) { if (type == VertexType.UpCorner) { if (m_Type == PolygonChainType.DownCorner) { m_Type = PolygonChainType.Both; } else { m_Type = PolygonChainType.UpCorner; } } else if (type == VertexType.DownCorner) { if (m_Type == PolygonChainType.UpCorner) { m_Type = PolygonChainType.Both; } else { m_Type = PolygonChainType.DownCorner; } } } /// <summary> /// 合并扫描线 /// </summary> private void CombineScanLine() { foreach (ScanLine v in listScanLine) { v.Combine(this); } } /// <summary> /// 生成单调多边形 /// </summary> /// <returns></returns> public List<MonotonePolygon> GeneralMonotonePolygon() { List<MonotonePolygon> listMp = new List<MonotonePolygon>(); List<Index2> listDiagonal = TriangulationDiagonal(); GeneralMonotonePolygon(listDiagonal, this.listPoints, ref listMp); return listMp; } /// <summary> /// 测试分割链条 /// </summary> /// <returns></returns> public List<List<Float2>> TestPolygon() { List<Index2> listDiagonal = TriangulationDiagonal(); List<List<Float2>> list = new List<List<Float2>>(); GeneralTestPolygon(listDiagonal, this.listPoints, ref list); return list; } /// <summary> /// 测试分割链条 /// </summary> /// <returns></returns> public List<Index2> TestDiagonal() { return TriangulationDiagonal(); } /// <summary> /// 得到剖分对象线 /// </summary> /// <returns></returns> private List<Index2> TriangulationDiagonal() { List<Index2> listDiagonal = new List<Index2>(); SweepLineStatus sls = new SweepLineStatus(); int count = listScanLine.Count; if (m_Type == PolygonChainType.Both || m_Type == PolygonChainType.UpCorner) { // y 从大到小 for (int i = count - 1; i >= 0; i--) { sls.UpdatePoints(listScanLine[i], ref listDiagonal, this, true); } } else { // y 从小到大 for (int i = 0; i < count; i++) { sls.UpdatePoints(listScanLine[i], ref listDiagonal, this, false); } } return listDiagonal; } /// <summary> /// 通过分隔对角线得到单调多边形 /// </summary> /// <param name="listDiagonal"></param> /// <param name="listMp"></param> private void GeneralMonotonePolygon(List<Index2> listDiagonal, List<VertexInfo> listPts, ref List<MonotonePolygon> listMp) { if (listMp == null) { listMp = new List<MonotonePolygon>(); } if (listDiagonal == null || listDiagonal.Count == 0) { listMp.Add(new MonotonePolygon(listPts)); } else { // 后续根据算法测试调整取值 Index2 first = listDiagonal[0]; listDiagonal.RemoveAt(0); List<VertexInfo> listCut1 = null; List<VertexInfo> listCut2 = null; if (CutPoints(first, listPts, ref listCut1, ref listCut2) == true) { List<Index2> listDiagonal1 = GetDiagonal(ref listDiagonal, listCut1); List<Index2> listDiagonal2 = GetDiagonal(ref listDiagonal, listCut2); GeneralMonotonePolygon(listDiagonal1, listCut1, ref listMp); GeneralMonotonePolygon(listDiagonal2, listCut2, ref listMp); } } } /// <summary> /// 通过分隔对角线得到单调多边形 /// </summary> /// <param name="listDiagonal"></param> /// <param name="listMp"></param> private void GeneralTestPolygon(List<Index2> listDiagonal, List<VertexInfo> listPts, ref List<List<Float2>> listMp) { if (listMp == null) { listMp = new List<List<Float2>>(); } if (listDiagonal == null || listDiagonal.Count == 0) { List<Float2> l = new List<Float2>(); foreach (VertexInfo v in listPts) { l.Add(v.pos); } listMp.Add(l); } else { // 后续根据算法测试调整取值 Index2 first = listDiagonal[0]; listDiagonal.RemoveAt(0); List<VertexInfo> listCut1 = null; List<VertexInfo> listCut2 = null; if (CutPoints(first, listPts, ref listCut1, ref listCut2) == true) { List<Index2> listDiagonal1 = GetDiagonal(ref listDiagonal, listCut1); List<Index2> listDiagonal2 = GetDiagonal(ref listDiagonal, listCut2); GeneralTestPolygon(listDiagonal1, listCut1, ref listMp); GeneralTestPolygon(listDiagonal2, listCut2, ref listMp); } } } /// <summary> /// 分隔链条 /// </summary> /// <param name="cutInfo"></param> /// <param name="listPts"></param> /// <param name="listCut1"></param> /// <param name="listCut2"></param> /// <returns></returns> private bool CutPoints(Index2 cutInfo, List<VertexInfo> listPts, ref List<VertexInfo> listCut1, ref List<VertexInfo> listCut2) { Index2 ret = FindPointsIndex(listPts, cutInfo); if (ret.p1 == -1 || ret.p2 == -1 || ret.p1 == ret.p2) return false; int maxIndex = System.Math.Max(ret.p1, ret.p2); int minIndex = System.Math.Min(ret.p1, ret.p2); // 分隔1 if (listCut1 == null) { listCut1 = new List<VertexInfo>(); } listCut1.Clear(); for (int i = minIndex; i <= maxIndex; i++) { listCut1.Add(listPts[i]); } // 分隔2 if (listCut2 == null) { listCut2 = new List<VertexInfo>(); } listCut2.Clear(); int count = listPts.Count; for (int i = maxIndex; i < count; i++) { listCut2.Add(listPts[i]); } for (int i = 0; i <= minIndex; i++) { listCut2.Add(listPts[i]); } return true; } /// <summary> /// 获取多边形中包含的对角线,并且进行剔除 /// </summary> /// <returns>得到的是决定的顶点序列</returns> private List<Index2> GetDiagonal(ref List<Index2> listDiagonal, List<VertexInfo> listPts) { List<Index2> listRet = new List<Index2>(); if (listDiagonal!= null && listDiagonal.Count > 0) { for (int i = 0; i < listDiagonal.Count;) { Index2 v = listDiagonal[i]; Index2 ret = FindPointsIndex(listPts, v); if (ret.p1!= -1 && ret.p2!= -1 && ret.p1!= ret.p2) { listRet.Add(v); listDiagonal.RemoveAt(i); } else i++; } } return listRet; } /// <summary> /// 查找对角线所在顶点 /// </summary> /// <param name="listPts"></param> /// <param name="Diagonal"></param> /// <returns></returns> private Index2 FindPointsIndex(List<VertexInfo> listPts, Index2 Diagonal) { int index1 = FindPointsIndex(listPts, Diagonal.p1); int index2 = FindPointsIndex(listPts, Diagonal.p2); return new Index2(index1, index2); } /// <summary> /// 查找索引 /// </summary> /// <param name="vertexIndex"></param> /// <param name="listPts"></param> /// <returns></returns> private int FindPointsIndex(List<VertexInfo> listPts, int vertexIndex) { if (listPts == null || listPts.Count == 0) return -1; int count = listPts.Count; for (int i = 0; i < count; i++) { if (listPts[i].fixIndex == vertexIndex) { return i; } } return -1; } /// <summary> /// 获取点的其点属性 /// </summary> /// <param name="prev"></param> /// <param name="cur"></param> /// <param name="next"></param> /// <returns></returns> private VertexType GetPointVertexType(VertexInfo prev, VertexInfo cur, VertexInfo next) { if (cur.pos.y >= next.pos.y && cur.pos.y >= prev.pos.y) { return VertexType.UpCorner; } else if (cur.pos.y <= next.pos.y && cur.pos.y <= prev.pos.y) { return VertexType.DownCorner; } else return VertexType.Normal; } /// <summary> /// 加入并排好序 /// </summary> /// <param name="v"></param> public void AddPoints(VertexInfo v) { int count = this.listScanLine.Count; if (count == 0) { this.listScanLine.Add(new ScanLine(v)); } else { BinaryInsert(v, 0, count - 1); } this.listPoints.Add(v); } /// <summary> /// 二分插入 /// </summary> /// <param name="targetValue"></param> /// <param name="minIndex"></param> /// <param name="maxIndex"></param> /// <returns></returns> private void BinaryInsert(VertexInfo targetValue, int minIndex, int maxIndex) { float targetValueY = targetValue.pos.y; while (minIndex <= maxIndex) { float minYvalue = this.listScanLine[minIndex].y; float maxYvalue = this.listScanLine[maxIndex].y; if (minYvalue < targetValueY && maxYvalue > targetValueY) { int middle = (minIndex + maxIndex) / 2; if (middle == minIndex) { this.listScanLine.Insert(minIndex + 1, new ScanLine(targetValue)); return; } else { float minddleY = this.listScanLine[middle].y; if (targetValueY == minddleY) { this.listScanLine[middle].AddPoints(targetValue); return; } else if (targetValueY > minddleY) { minIndex = middle; } else if (targetValueY < minddleY) { maxIndex = middle; } } } else if (minYvalue == targetValueY) { this.listScanLine[minIndex].AddPoints(targetValue); return; } else if (maxYvalue == targetValueY) { this.listScanLine[maxIndex].AddPoints(targetValue); return; } else if (minYvalue > targetValueY) { this.listScanLine.Insert(0, new ScanLine(targetValue)); return; } else if (maxYvalue < targetValueY) { this.listScanLine.Add(new ScanLine(targetValue)); return; } } } /// <summary> /// 获取顶点数据,安全的获取 /// </summary> /// <param name="index"></param> /// <returns></returns> public VertexInfo GetVertexInfo(int index) { if (index >= 0 && index < listPoints.Count) { return listPoints[index]; } else if (index < 0) { return this.listPoints[countPonts - 1]; } else { return this.listPoints[0]; } } /// <summary> /// 查找边的另外一个顶点,边的edge 连接的 /// </summary> /// <param name="edge"></param> /// <returns></returns> public VertexInfo GetOtherPoints(Edge edge) { int endIndex = edge.end.indexInPolygonChain; int startIndex = edge.start.indexInPolygonChain; int diff = System.Math.Abs(endIndex - startIndex); if (diff == 1) { if (endIndex > startIndex) { return GetVertexInfo(endIndex + 1); } else { return GetVertexInfo(endIndex - 1); } } else // 说明end 要不是0 ,要不是最后一个点 { if (endIndex > startIndex) { return GetVertexInfo(endIndex - 1); } else { return GetVertexInfo(endIndex + 1); } } } /// <summary> /// 判断是同一条边上的点 /// </summary> /// <param name="index1"></param> /// <param name="index2"></param> /// <returns></returns> public bool CheckSameEdge(int index1, int index2) { int diff = System.Math.Abs(index1 - index2); if (diff == 1 || diff == this.countPonts - 1) return true; else return false; } } /// <summary> /// 多边形链特点 /// </summary> public enum PolygonChainType { None = 0, // 不存在,也就是单调链了 UpCorner = 1, // 向上拐 ^ DownCorner = 2, // 向下拐 Both = 3, // 都存在 } } ======================= File: Assets/Scripts/Graphics/Geometric/3D/Line3D.cs ======================= <reponame>741645596/graph using System.Collections; using System.Collections.Generic; using RayGraphics.Math; namespace RayGraphics.Geometric { /// <summary> /// 直线 /// </summary> public class Line3D : iGeo3DElement { /// <summary> /// 直线上得点 /// </summary> protected Double3 _startPoint; public Double3 StartPoint { get { return _startPoint; } } /// <summary> /// 方向为单位向量 /// </summary> protected Double3 _normalizedDir; public Double3 NormalizedDir { get { return _normalizedDir; } } public Line3D() { this._startPoint = Double3.zero; this._normalizedDir = Double3.up; } public Line3D(Double3 startPt, Double3 dir) { this._startPoint = startPt; this._normalizedDir = dir.normalized; } /// <summary> /// 判断点是否在直线上 /// </summary> /// <param name="pt"></param> /// <returns></returns> public virtual bool CheckIn(Double3 pt) { Double3 aixsVector = this.AixsVector(pt); if (aixsVector == Double3.zero) return true; else return false; } /// <summary> /// 点导几何元素的距离 /// </summary> /// <param name="pt"></param> /// <returns></returns> public virtual double CalcDistance(Double3 pt) { Double3 aixsVector = this.AixsVector(pt); return aixsVector.magnitude; } /// <summary> /// 点导几何元素的投影点 /// </summary> /// <param name="pt"></param> /// <returns></returns> public virtual Double3 ProjectPoint(Double3 pt) { Double3 diff = pt - this.StartPoint; if (diff == Double3.zero) return pt; return Double3.Project(diff, this.NormalizedDir) + this.StartPoint; } /// <summary> /// 求轴向量 /// </summary> /// <param name="pt"></param> /// <returns></returns> public virtual Double3 AixsVector(Double3 pt) { Double3 diff = pt - this.StartPoint; if (diff == Double3.zero) return Double3.zero; return diff - Double3.Project(diff, this.NormalizedDir); } /// <summary> /// 与线的关系 /// </summary> /// <param name="line"></param> /// <returns></returns> public virtual LineRelation CheckLineRelation(Line3D line) { if (line == null) return LineRelation.None; if (CheckInSamePlane(this, line) == false) { if (Double3.Cross(this.NormalizedDir, line.NormalizedDir) == Double3.zero) { Double3 diff = line.StartPoint - this.StartPoint; if (Double3.Cross(this.NormalizedDir, diff) == Double3.zero) { return LineRelation.Coincide; } else { return LineRelation.Parallel; } } else { return LineRelation.Intersect; } } else { return LineRelation.Detach; } } /// <summary> /// 获取交点 /// </summary> /// <param name="line"></param> /// <param name="intersectPoint"></param> /// <returns></returns> public virtual bool GetIntersectPoint(Line3D line, ref Double3 intersectPoint) { if (line == null) return false; Double3 aixsVector = AixsVector(line.StartPoint); double distance = aixsVector.magnitude; if (distance == 0) { intersectPoint = line.StartPoint; return true; } else { double dot = Double3.Dot(aixsVector.normalized, line.NormalizedDir); if (dot == 0) { return false; } else { intersectPoint = line.StartPoint - distance / dot * line.NormalizedDir; return true; } } } /// <summary> /// 判断是否在相同的平面 /// </summary> /// <param name="line1"></param> /// <param name="line2"></param> /// <returns></returns> public static bool CheckInSamePlane(Line3D line1, Line3D line2) { if (line1 == null||line2 == null) return false; // 判断是否共面 Double3 diff = line2.StartPoint - line1.StartPoint; Double3 VerticalAxis = Line3D.GetVerticalAxis(line1, line2); return Double3.Dot(diff, VerticalAxis) == 0? true : false; } /// <summary> /// 获取垂直轴 /// </summary> /// <param name="line1"></param> /// <param name="line2"></param> /// <returns></returns> public static Double3 GetVerticalAxis(Line3D line1, Line3D line2) { if (line1 == null || line2 == null) return Double3.zero; return Double3.Cross(line1.NormalizedDir, line2.NormalizedDir); } } } ======================= File: Assets/Scripts/Graphics/Geometric/2D/Polygon2D.cs ======================= <gh_stars>0 using RayGraphics.Math; using System.Collections.Generic; namespace RayGraphics.Geometric { public class Polygon2D : AABB2D { /// <summary> /// 顶点列表 /// </summary> private Double2[] pointArr = null; /// <summary> /// 法线列表。 /// </summary> private Double2[] normalAttr = null; /// <summary> /// 顶点可同行数组 /// </summary> private HashSet<int> listunCrossPoints = null; /// <summary> /// 逆时针 /// </summary> private double[] distancArr = null; private double totalDistance = 0; public Polygon2D(Double2Bool[] points) { if (points == null || points.Length < 3) return; List<Double2> lpoints = new List<Double2>(); List<int> unCrossPoints = new List<int>(); for (int i = 0; i < points.Length; i++) { lpoints.Add(new Double2(points[i].x, points[i].y)); if (points[i].isCross == false) { unCrossPoints.Add(i); } } Init(lpoints.ToArray()); if (unCrossPoints!= null && unCrossPoints.Count > 0) { listunCrossPoints = new HashSet<int>(); foreach (int index in unCrossPoints) { listunCrossPoints.Add(index); } } } public Polygon2D(Double2[] points, List<int> unCrossPoints) { Init(points); if (unCrossPoints!= null && unCrossPoints.Count > 0) { listunCrossPoints = new HashSet<int>(); foreach (int index in unCrossPoints) { listunCrossPoints.Add(index); } } } public Polygon2D(Double2[] points) { Init(points); } /// <summary> /// 初始化数据 /// </summary> /// <param name="points"></param> private void Init(Double2[] points) { if (points == null || points.Length < 3) return; this.pointArr = new Double2[points.Length]; this.normalAttr = new Double2[points.Length]; this.distancArr = new double[points.Length + 1]; Double2 min = points[0]; Double2 max = points[0]; int i; for (i = 0; i < points.Length; i++) { this.pointArr[i] = points[i]; if (i > 0) { min = Double2.Min(min, points[i]); max = Double2.Max(max, points[i]); totalDistance += MathUtil.GetNearDistance(points[i - 1], points[i]); this.distancArr[i] = totalDistance; } else { min = points[i]; max = points[i]; this.distancArr[i] = 0; totalDistance = 0; } // Double2 dir; if (i < points.Length - 1) { dir = (points[i + 1] - points[i]).normalized; } else { dir = (points[0] - points[i]).normalized; } this.normalAttr[i] = Double2.Perpendicular(dir); } totalDistance += MathUtil.GetNearDistance(points[points.Length - 1], points[0]); this.distancArr[i] = totalDistance; this.SetAABB(min, max); } /// <summary> /// 最短射线包围盒路径 /// </summary> /// <param name="line">线段</param> /// <param name="offset">偏移值</param> /// <param name="rbi">包围盒信息</param> /// <returns>true,表示线段与aabb有相交,并返回最短包围路径</returns> public override RBIResultType RayboundingNearestPath(LineSegment2D line, double offset, ref RayboundingInfo rbi) { if (rbi == null) { rbi = new RayboundingInfo(); } List<Double3> lineArray = new List<Double3>(); Double2 intersectionPoint = Double2.zero; Double2 pos1 = Double2.zero; for (int i = 0; i < this.pointArr.Length; i++) { if (line.GetIntersectPoint(GetEdge(i), ref intersectionPoint, ref pos1) == true) { lineArray.Add(new Double3(intersectionPoint.x, intersectionPoint.y, i)); } } int count = lineArray.Count; if (count == 0) { return RBIResultType.Fail; } else if (count % 2 == 1) { lineArray.Sort((x, y) => MathUtil.GetCompareDis(new Double2(x.x, x.y), line.startPoint).CompareTo(MathUtil.GetCompareDis(new Double2(y.x, y.y), line.startPoint))); if (CheckIn(line.startPoint) == true) { rbi.SetNear(line, offset, new Double2(lineArray[0].x, lineArray[0].y)); return RBIResultType.UnCrossstartPointIn; } else { rbi.SetNear(line, offset, new Double2(lineArray[count - 1].x, lineArray[count - 1].y)); return RBIResultType.UnCrossendPointIn; } } else { // 先按距离进行排序。 lineArray.Sort((x, y) => MathUtil.GetCompareDis(new Double2(x.x, x.y), line.startPoint).CompareTo(MathUtil.GetCompareDis(new Double2(y.x, y.y), line.startPoint))); // bool isCross = true; bool isPathDir = CheckPathDir(lineArray[0], lineArray[lineArray.Count - 1], ref isCross); if (isCross == false) { rbi.SetNear(line, offset, new Double2(lineArray[0].x, lineArray[0].y)); return RBIResultType.UnCross; } List<Double2> temppaths = new List<Double2>(); RayboundingNearestPath(lineArray[0], lineArray[lineArray.Count - 1], offset, isPathDir, ref temppaths); if (rbi.listpath == null) { rbi.listpath = temppaths; } else { rbi.listpath.AddRange(temppaths); } // 排斥需要扣除的点。 for (int i = 1; i < lineArray.Count - 1; i += 2) { if (CheckisSubChild((int)lineArray[0].z, (int)lineArray[lineArray.Count - 1].z, isPathDir, (int)lineArray[i].z, (int)lineArray[i + 1].z) == false) continue; List<Double2> listTemp = new List<Double2>(); RayboundingNearestPath(lineArray[i], lineArray[i + 1], offset, isPathDir, ref listTemp); if (listTemp.Count > 0) { foreach (Double2 pos in listTemp) { rbi.listpath.Remove(pos); } } } // if (rbi.listpath!= null && rbi.listpath.Count > 0) { rbi.CalcHelpData(line, offset, new Double2(lineArray[0].x, lineArray[0].y), new Double2(lineArray[lineArray.Count - 1].x, lineArray[lineArray.Count - 1].y)); return RBIResultType.Succ; } return RBIResultType.Fail; } } /// <summary> /// 确定是否为其子集, 先简单实现。 /// </summary> /// <returns></returns> private bool CheckisSubChild(int start, int end, bool isPathDir, int substart, int subend) { List<int> listall = GetPathPoint(start, end, isPathDir); List<int> listsub = GetPathPoint(substart, subend, isPathDir); foreach (int index in listsub) { listall.Remove(index); } if (listall.Count == 0) return false; else return true; } /// <summary> /// 中间经过的顶点,不包含2端的点。 /// </summary> /// <param name="p1"></param> /// <param name="p2"></param> /// <param name="offset"></param> /// <param name="isPathDir"></param> /// <param name="paths"></param> private void RayboundingNearestPath(Double3 p1, Double3 p2, double offset, bool isPathDir, ref List<Double2> paths) { List<Double2> listpath = new List<Double2>(); // 先计算逆时针距离。 if (p1.z < p2.z) { if (isPathDir == true) { for (int i = (int)p1.z + 1; i <= (int)p2.z; i++) { listpath.Add(GetOutPoint(i, offset)); } } else { for (int i = (int)p1.z; i >= 0; i--) { listpath.Add(GetOutPoint(i, offset)); } // for (int i = this.pointArr.Length - 1; i > (int)p2.z; i--) { listpath.Add(GetOutPoint(i, offset)); } } } else if (p1.z > p2.z) { if (isPathDir == false) { for (int i = (int)p1.z; i >= (int)p2.z + 1; i--) { listpath.Add(GetOutPoint(i, offset)); } } else { for (int i = (int)p1.z + 1; i < this.pointArr.Length; i++) { listpath.Add(GetOutPoint(i, offset)); } for (int i = 0; i <= (int)p2.z; i++) { listpath.Add(GetOutPoint(i, offset)); } } } paths = listpath; } /// <summary> /// 中间经过的顶点,不包含2端的点。 /// </summary> /// <param name="startIndex"></param> /// <param name="endIndex"></param> /// <param name="offset"></param> /// <param name="isPathDir"></param> /// <param name="paths"></param> private List<int> GetPathPoint(int startIndex, int endIndex, bool isPathDir) { List<int> listpath = new List<int>(); // 先计算逆时针距离。 if (startIndex < endIndex) { if (isPathDir == true) { for (int i = startIndex + 1; i <= endIndex; i++) { listpath.Add(i); } } else { for (int i = startIndex; i >= 0; i--) { listpath.Add(i); } // for (int i = this.pointArr.Length - 1; i > endIndex; i--) { listpath.Add(i); } } } else if (startIndex > endIndex) { if (isPathDir == false) { for (int i = startIndex; i >= endIndex + 1; i--) { listpath.Add(i); } } else { for (int i = startIndex + 1; i < this.pointArr.Length; i++) { listpath.Add(i); } for (int i = 0; i <= endIndex; i++) { listpath.Add(i); } } } return listpath; } /// <summary> /// 获取指定顶点的外部偏移点 /// </summary> /// <param name="index"></param> /// <param name="offset"></param> /// <returns></returns> private Double2 GetOutPoint(int index, double offset) { if (index < 0 || index >= this.pointArr.Length) return Double2.zero; Double2 diff; if (index == 0) { diff = GetNormal(this.pointArr.Length - 1) + GetNormal(0); } else { diff = GetNormal(index - 1) + GetNormal(index); } return this.pointArr[index] + offset * diff.normalized; } /// <summary> /// 确认方向(顺时针,逆时针方向) /// </summary> /// <param name="p1"></param> /// <param name="p2"></param> private bool CheckPathDir(Double3 p1, Double3 p2, ref bool isCross) { isCross = true; int crossValue = GetCrossValue((int)p1.z, (int)p2.z); if (crossValue == 3) { isCross = false; return false; } // 先计算逆时针距离。 double dis; // 对边行为 if (p1.z < p2.z) { if (crossValue == 1) { return false; } else if (crossValue == 2) { return true; } int max = (int)p2.z + 1; max = max > this.pointArr.Length - 1? 0 : max; dis = distancArr[(int)p2.z + 1] - distancArr[(int)p1.z] - MathUtil.GetNearDistance(new Double2(p1.x, p1.y), this.pointArr[(int)p1.z]) - MathUtil.GetNearDistance(new Double2(p2.x, p2.y), this.pointArr[max]); if (dis < totalDistance - dis) { return true; } else { return false; } } else if (p1.z > p2.z) { if (crossValue == 1) { return true; } else if (crossValue == 2) { return false; } int max = (int)p1.z + 1; max = max > this.pointArr.Length - 1? 0 : max; dis = distancArr[(int)p1.z + 1] - distancArr[(int)p2.z] - MathUtil.GetNearDistance(new Double2(p2.x, p2.y), this.pointArr[(int)p2.z]) - MathUtil.GetNearDistance(new Double2(p1.x, p1.y), this.pointArr[max]); if (dis < totalDistance - dis) { return false; } else { return true; } } else { return true; } } /// <summary> /// /// </summary> /// <param name="index1"></param> /// <param name="index2"></param> /// <returns>0, 可以通。1. 升序不可通, 2 降序不可通, 3 都不可通</returns> private int GetCrossValue(int index1, int index2) { int value = 0; if (index1 > index2) { int temp = index2; index2 = index1; index1 = temp; } // 升序 for (int i = index1 + 1; i <= index2; i++) { if (CheckCrossPoint(i) == false) { value = 1; break; } } // 降序 for (int i = index2 + 1; i < this.pointArr.Length; i++) { if (CheckCrossPoint(i) == false) { value += 2; return value; } } for (int i = 0; i <= index1; i++) { if (CheckCrossPoint(i) == false) { value += 2; return value; } } return value; } /// <summary> /// 获取挡格附近出生点 /// </summary> /// <param name="line"></param> /// <param name="offset"></param> /// <param name="bornPoint"></param> /// <returns></returns> public override bool GetBornPoint(LineSegment2D line, double offset, ref Double2 bornPoint) { Double2 pos1 = Double2.zero; for (int i = 0; i < this.pointArr.Length; i++) { if (line.GetIntersectPoint(GetEdge(i), ref bornPoint, ref pos1) == true) { bornPoint = line.normalizedDir * ((bornPoint - line.startPoint).magnitude + offset) + line.startPoint; return true; } } return false; } /// <summary> /// 与线段的关系 /// </summary> /// <param name="line"></param> /// <returns></returns> public override LineRelation CheckLineRelation(LineSegment2D line) { Double2 pos = Double2.zero; Double2 pos1 = Double2.zero; for (int i = 0; i < this.pointArr.Length; i++) { if (line.GetIntersectPoint(GetEdge(i), ref pos, ref pos1) == true) { return LineRelation.Intersect; } } return LineRelation.Detach; } /// <summary> /// 获取多边形的类型,凹的还是凸的。 /// </summary> /// <returns></returns> public PolygonType GetPolygonType() { double prev = CalcRotateValue(this.pointArr.Length - 1); double cur; for (int i = 0; i < this.pointArr.Length; i++) { cur = CalcRotateValue(i); if (cur * prev < 0) { return PolygonType.Concave; } prev = cur; } return PolygonType.Convex; } /// <summary> /// 计算某个顶点叉乘。 /// </summary> /// <param name="index"></param> /// <returns></returns> private double CalcRotateValue(int index) { if (index < 0 || index >= this.pointArr.Length) return 0; if (index > 0) { return Double2.Cross(GetEdge(index - 1).normalizedDir, GetEdge(index).normalizedDir); } else if (index == 0) { return Double2.Cross(GetEdge(this.pointArr.Length - 1).normalizedDir, GetEdge(0).normalizedDir); } return 0; } /// <summary> /// 获取线段与多边形的所有交点,并按从近到远排序。,float3 z记录与多边形相交的边。 /// </summary> /// <param name="line"></param> /// <param name="paths"></param> public void GetAllIntersectPoint(LineSegment2D line, ref List<Double3> paths) { List<Double3> listpath = new List<Double3>(); Double2 point = Double2.zero; Double2 point1 = Double2.zero; for (int i = 0; i < this.pointArr.Length; i++) { LineSegment2D ls = GetEdge(i); if (line.GetIntersectPoint(ls, ref point, ref point1) == true) { if (point1 == point) // 肯定是交于端点,需特殊处理 { if (point1 == ls.endPoint) { int id = (i + 1) % this.pointArr.Length; listpath.Add(new Double3(point1.x, point1.y, id)); } else { listpath.Add(new Double3(point1.x, point1.y, i)); } } else { if (point1 == ls.endPoint) { int id = (i + 1) % this.pointArr.Length; listpath.Add(new Double3(point1.x, point1.y, id)); } else { listpath.Add(new Double3(point1.x, point1.y, i)); } if (point == ls.endPoint) { int id = (i + 1) % this.pointArr.Length; listpath.Add(new Double3(point.x, point.y, id)); } else { listpath.Add(new Double3(point.x, point.y, i)); } } } } // 从近到远排好队。 if (listpath.Count > 1) { listpath.Sort((x, y) => MathUtil.GetCompareDis(new Double2(x.x, x.y), line.startPoint).CompareTo(MathUtil.GetCompareDis(new Double2(y.x, y.y), line.startPoint))); } paths = listpath; } /// <summary> /// 获取边 /// </summary> /// <param name="edgeIndex"></param> /// <returns></returns> public override LineSegment2D GetEdge(int edgeIndex) { if (edgeIndex < 0 || edgeIndex > this.pointArr.Length - 1) { return new LineSegment2D(Double2.zero, Double2.zero); } else if (edgeIndex == this.pointArr.Length - 1) { return new LineSegment2D(this.pointArr[edgeIndex], this.pointArr[0]); } else { return new LineSegment2D(this.pointArr[edgeIndex], this.pointArr[edgeIndex + 1]); } } /// <summary> /// 获取边 /// </summary> /// <param name="edgeIndex"></param> /// <returns></returns> public override Point2D GetSimpleEdge(int edgeIndex) { if (edgeIndex < 0 || edgeIndex > this.pointArr.Length - 1) { return new Point2D(Double2.zero, Double2.zero); } else if (edgeIndex == this.pointArr.Length - 1) { return new Point2D(this.pointArr[edgeIndex], this.pointArr[0]); } else { return new Point2D(this.pointArr[edgeIndex], this.pointArr[edgeIndex + 1]); } } /// <summary> /// 获取法线 /// </summary> /// <param name="edgeIndex"></param> /// <returns></returns> public override Double2 GetNormal(int edgeIndex) { if (edgeIndex < 0 || edgeIndex > this.normalAttr.Length - 1) { return Double2.zero; } return this.normalAttr[edgeIndex]; } /// <summary> /// 获取顶点 /// </summary> /// <param name="index"></param> /// <returns></returns> public override Double2 GetPoint(int index) { if (index < 0 || index > this.pointArr.Length - 1) { return Double2.zero; } return this.pointArr[index]; } /// <summary> /// 获取顶点 /// </summary> /// <param name="index"></param> /// <returns></returns> public override Double2Bool GetPointPlus(int index) { if (index < 0 || index > this.pointArr.Length - 1) { new Double2Bool(Double2.zero, true); } return new Double2Bool(this.pointArr[index], CheckCrossPoint(index)); } /// <summary> /// 获取顶点数组 /// </summary> /// <returns></returns> public override Double2Bool[] GetPointsPlus() { Double2Bool[] points = new Double2Bool[this.pointArr.Length]; for (int i = 0; i < points.Length; i++) { points[i] = GetPointPlus(i); } return points; } /// <summary> /// 与矩形的关系 /// </summary> /// <param name="dbd1"></param> /// <returns>true 相交: false 不相交</returns> public override bool CheckIntersect(Rect2D ab) { if (ab == null) return false; return ab.CheckIntersect(this); } /// <summary> /// 与圆的关系 /// </summary> /// <param name="dbd1"></param> /// <returns>true 相交: false 不相交</returns> public override bool CheckIntersect(Circle2D ab) { if (ab == null) return false; return ab.CheckIntersect(this); } /// <summary> /// 与多边形的关系 /// </summary> /// <param name="dbd1"></param> /// <returns>true 相交: false 不相交</returns> public override bool CheckIntersect(Polygon2D ab) { if (ab == null) return false; for (int i = 0; i < ab.GetEdgeNum(); i++) { if (this.CheckIn(ab.GetPoint(i)) == true) { return true; } if (this.CheckLineRelation(ab.GetEdge(i)) == LineRelation.Intersect) { return true; } } return false; } /// <summary> /// 获取边数 /// </summary> /// <returns></returns> public override int GetEdgeNum() { return this.pointArr.Length; } /// <summary> /// 获取顶点数组 /// </summary> /// <returns></returns> public override Double2[] GetPoints() { return this.pointArr; } /// <summary> /// 判断点多边形内。 /// </summary> /// <param name="pt"></param> /// <returns></returns> public override bool CheckIn(Double2 pt) { if (base.CheckIn(pt) == false) return false; // 做射线, y = pt.y // 经过顶点的。 int CrossPointCount = 0; bool flag = false; int edgeNum = GetEdgeNum(); for (int i = 0; i < edgeNum; i++) { Point2D line = GetSimpleEdge(i); // 先判断点是否在边上。 if (line.CheckIn(pt) == true) return true; Double2 diff = line.endPoint - line.startPoint; if ((line.startPoint.y <= pt.y && line.endPoint.y >= pt.y) || (line.startPoint.y >= pt.y && line.endPoint.y <= pt.y)) { if (diff.y!= 0) { double x = line.startPoint.x + (pt.y - line.startPoint.y) * diff.x / diff.y; // 射线穿过多边形的边界 if (x > pt.x) { // 统计经过顶点的次数 if (line.startPoint.y == pt.y || line.endPoint.y == pt.y) { CrossPointCount++; } flag =!flag; } } // 共线情况,肯定是点在线段2端。 } } CrossPointCount /= 2; CrossPointCount %= 2; if (CrossPointCount == 1) { flag =!flag; } return flag; } /// <summary> /// 判断某个顶点是否可通行 /// </summary> /// <param name="indexPoint"></param> /// <returns></returns> public override bool CheckCrossPoint(int indexPoint) { if (listunCrossPoints == null || listunCrossPoints.Count == 0) return true; if (listunCrossPoints.Contains(indexPoint) == true) { return false; } return true; } /// <summary> /// 获取顶点可通过数据 /// </summary> /// <returns></returns> public override HashSet<int> GetCrossPointData() { return listunCrossPoints; } /// <summary> /// 获取近的相交点 /// </summary> /// <param name="line"></param> /// <param name="intersectStart"></param> /// <returns></returns> public override bool GetNearIntersectPoint(LineSegment2D line, ref Double2 intersectStart) { bool ret = false; intersectStart = Double2.positiveInfinity; double dis = float.MaxValue; Double2 pos = Double2.zero; Double2 pos1 = Double2.zero; for (int i = 0; i < GetEdgeNum(); i++) { if (GetEdge(i).GetIntersectPoint(line, ref pos, ref pos1) == true) { ret = true; double dis1 = MathUtil.GetCompareDis(line.startPoint, pos); double dis2 = MathUtil.GetCompareDis(line.startPoint, pos1); if (dis1 < dis) { intersectStart = pos; dis = dis1; } if (dis2 < dis) { intersectStart = pos1; dis = dis2; } } } return ret; } /// <summary> /// 获取与x轴线与边界最接近的2个点 /// </summary> /// <param name="xAixs"></param> /// <param name="nearStep"></param> /// <param name="pt1"></param> /// <param name="pt2"></param> /// <returns>false :不相交 true;相交</returns> public bool GetPointsInAreabyXaixs(double xAixs, double nearStep, ref Double2 pt1, ref Double2 pt2) { if (xAixs <= this.leftBottom.x) return false; if (xAixs >= this.rightUp.x) return false; List<Double2> listIntersectPoints = new List<Double2>(); int edgeNum = GetEdgeNum(); for (int i = 0; i < edgeNum; i++) { Point2D line = GetSimpleEdge(i); Double2 diff = line.endPoint - line.startPoint; if ((line.startPoint.x <= xAixs && line.endPoint.x >= xAixs) || (line.startPoint.x >= xAixs && line.endPoint.x <= xAixs)) { if (diff.x!= 0) { double y = line.startPoint.y + (xAixs - line.startPoint.x) * diff.y / diff.x; listIntersectPoints.Add(new Double2(xAixs, y)); } else // 共线情况,肯定是点在线段2端。 { listIntersectPoints.Add(line.startPoint); listIntersectPoints.Add(line.endPoint); } } } if (listIntersectPoints.Count < 2) { return false; } // 获取最小的y及最大的y。 double minY = double.PositiveInfinity; double maxY = double.NegativeInfinity; foreach (Double2 pos in listIntersectPoints) { minY = System.Math.Min(minY,pos.y); maxY = System.Math.Max(maxY, pos.y); } if (minY + nearStep >= maxY - nearStep) { return false; } else { pt1 = new Double2(xAixs, minY + nearStep); pt2 = new Double2(xAixs, maxY - nearStep); } return true; } /// <summary> /// 获取与Y轴线与边界最接近的2个点 /// </summary> /// <param name="YAixs"></param> /// <param name="nearStep"></param> /// <param name="pt1"></param> /// <param name="pt2"></param> /// <returns>false :不相交 true;相交</returns> public bool GetPointsInAreabyYaixs(double YAixs, double nearStep, ref Double2 pt1, ref Double2 pt2) { if (YAixs <= this.leftBottom.y) return false; if (YAixs >= this.rightUp.y) return false; List<Double2> listIntersectPoints = new List<Double2>(); int edgeNum = GetEdgeNum(); for (int i = 0; i < edgeNum; i++) { Point2D line = GetSimpleEdge(i); Double2 diff = line.endPoint - line.startPoint; if ((line.startPoint.y <= YAixs && line.endPoint.y >= YAixs) || (line.startPoint.y >= YAixs && line.endPoint.y <= YAixs)) { if (diff.y!= 0) { double x = line.startPoint.x + (YAixs - line.startPoint.y) * diff.x / diff.y; listIntersectPoints.Add(new Double2(x,YAixs)); } else // 共线情况,肯定是点在线段2端。 { listIntersectPoints.Add(line.startPoint); listIntersectPoints.Add(line.endPoint); } } } if (listIntersectPoints.Count < 2) { return false; } // 获取最小的y及最大的y。 double minX = double.PositiveInfinity; double maxX = double.NegativeInfinity; foreach (Double2 pos in listIntersectPoints) { minX = System.Math.Min(minX, pos.x); maxX = System.Math.Max(maxX, pos.x); } if (minX + nearStep >= maxX - nearStep) { return false; } else { pt1 = new Double2(minX + nearStep, YAixs); pt2 = new Double2(maxX - nearStep, YAixs); } return true; } } } ======================= File: Assets/Scripts/Graphics/Math/Matrix2x2.cs ======================= <reponame>741645596/graph using System; /// <summary> /// 矩阵 /// </summary> namespace RayGraphics.Math { public struct Matrix2x2 { /// <summary> /// 第一行 /// </summary> public Double2 col1; /// <summary> /// 第二行 /// </summary> public Double2 col2; /// <summary> /// 第一列 /// </summary> public Double2 row1 { get { return new Double2(col1.x, col2.x); } } /// <summary> /// 第二列 /// </summary> public Double2 row2 { get { return new Double2(col1.y, col2.y); } } /// <summary> /// /// </summary> /// <param name="col1"></param> /// <param name="col2"></param> public Matrix2x2(Double2 col1, Double2 col2) { this.col1 = col1; this.col2 = col2; } /// <summary> /// 设置属性 /// </summary> /// <param name="x"></param> /// <param name="y"></param> public void Set(Double2 col1, Double2 col2) { this.col1 = col1; this.col2 = col2; } /// <summary> /// 索引访问 /// </summary> /// <param name="col"></param> /// <param name="row"></param> /// <returns></returns> public double this[int col,int row] { get { if (col == 0) return this.col1[row]; else if (col == 1) return this.col2[row]; else return 0; } set { if (col == 0) this.col1[row] = value; else if (col == 1) this.col2[row] = value; } } /// <summary> /// 0 矩阵 /// </summary> public static Matrix2x2 zero { get { return s_zero; } } private static readonly Matrix2x2 s_zero = new Matrix2x2(Double2.zero, Double2.zero); /// <summary> /// 单位矩阵 /// </summary> public static Matrix2x2 one { get { return s_one; } } private static readonly Matrix2x2 s_one = new Matrix2x2(Double2.right, Double2.up); /// <summary> /// 旋转矩阵,逆时针旋转angle /// </summary> /// <param name="angle">旋转角度</param> /// <returns></returns> public static Matrix2x2 RotateMatrix(double angle) { double cosAngle = MathFunc.cosAngle(angle); double sinAngle = MathFunc.sinAngle(angle); Double2 col1 = new Double2(cosAngle, sinAngle); Double2 col2 = new Double2(-sinAngle, cosAngle); return new Matrix2x2(col1, col2); } /// <summary> /// 缩放矩阵 /// </summary> /// <param name="scaleX"></param> /// <param name="scaleY"></param> /// <returns></returns> public static Matrix2x2 ScaleMatrix(double scaleX, double scaleY) { Double2 col1 = new Double2(scaleX, 0); Double2 col2 = new Double2(0, scaleY); return new Matrix2x2(col1, col2); } /// <summary> /// 缩放矩阵 /// </summary> /// <param name="scale"></param> /// <returns></returns> public static Matrix2x2 ScaleMatrix(float scale) { Double2 col1 = new Double2(scale, 0); Double2 col2 = new Double2(0, scale); return new Matrix2x2(col1, col2); } /// <summary> /// 沿着指定轴进行缩放 /// </summary> /// <param name="axis">指定轴的法向量</param> /// <param name="scale">缩放比例</param> /// <returns></returns> public static Matrix2x2 ScaleMatrix(Double2 axis, float scale) { double dx = (scale - 1) * axis.x; double dy = (scale - 1) * axis.y; Double2 col1 = new Double2(1+ dx * axis.x, dx * axis.y); Double2 col2 = new Double2(dy * axis.x, 1+ dy * axis.y); return new Matrix2x2(col1, col2); } /// <summary> /// 投影到X轴的正交投影矩阵 /// </summary> /// <returns></returns> public static Matrix2x2 XOrthogonalProjectionMatrix() { Double2 col1 = Double2.right; Double2 col2 = Double2.zero; return new Matrix2x2(col1, col2); } /// <summary> /// 投影到X轴的正交投影矩阵 /// </summary> /// <returns></returns> public static Matrix2x2 YOrthogonalProjectionMatrix() { Double2 col1 = Double2.zero; Double2 col2 = Double2.up; return new Matrix2x2(col1, col2); } /// <summary> /// 矩阵判断相等 /// </summary> /// <param name="v1"></param> /// <param name="v2"></param> /// <returns></returns> public static bool operator!=(Matrix2x2 v1, Matrix2x2 v2) { return v1.col1!= v2.col1 || v1.col2!= v2.col2; } /// <summary> /// 矩阵判断相等 /// </summary> /// <param name="v1"></param> /// <param name="v2"></param> /// <returns></returns> public static bool operator ==(Matrix2x2 v1, Matrix2x2 v2) { return v1.col1 == v2.col1 && v1.col2 == v2.col2; } /// <summary> /// 矩阵+ /// </summary> /// <param name="v1"></param> /// <param name="v2"></param> /// <returns></returns> public static Matrix2x2 operator +(Matrix2x2 v1, Matrix2x2 v2) { Double2 m1 = v1.col1 + v2.col1; Double2 m2 = v1.col2 + v2.col2; return new Matrix2x2(m1, m2); } /// <summary> /// 矩阵- /// </summary> /// <param name="v1"></param> /// <param name="v2"></param> /// <returns></returns> public static Matrix2x2 operator -(Matrix2x2 v1, Matrix2x2 v2) { Double2 m1 = v1.col1 - v2.col1; Double2 m2 = v1.col2 - v2.col2; return new Matrix2x2(m1, m2); } /// <summary> /// * 运算 /// </summary> /// <param name="k"></param> /// <param name="vector"></param> /// <returns></returns> public static Matrix2x2 operator *(double k, Matrix2x2 v) { Double2 col1 = v.col1 * k; Double2 col2 = v.col2 * k; return new Matrix2x2(col1, col2); } /// <summary> /// * 运算 /// </summary> /// <param name="k"></param> /// <param name="vector"></param> /// <returns></returns> public static Matrix2x2 operator *(Matrix2x2 v, double k) { Double2 col1 = v.col1 * k; Double2 col2 = v.col2 * k; return new Matrix2x2(col1, col2); } /// <summary> /// * 运算 /// </summary> /// <param name="m1"></param> /// <param name="m2"></param> /// <returns></returns> public static Matrix2x2 operator *(Matrix2x2 m1, Matrix2x2 m2) { Double2 col1 = new Double2(Double2.Dot(m1.col1, m2.row1), Double2.Dot(m1.col1, m2.row2)); Double2 col2 = new Double2(Double2.Dot(m1.col2, m2.row1), Double2.Dot(m1.col2, m2.row2)); return new Matrix2x2(col1, col2); } /// <summary> /// * 运算 /// </summary> /// <param name="m"></param> /// <param name="v">作为列向量</param> /// <returns></returns> public static Double2 operator *(Matrix2x2 m, Double2 v) { return new Double2(Double2.Dot(m.col1, v), Double2.Dot(m.col2, v)); } /// <summary> /// * 运算 /// </summary> /// <param name="v">作为行向量</param> /// <param name="m"></param> /// <returns></returns> public static Double2 operator *(Double2 v, Matrix2x2 m) { return new Double2(Double2.Dot(v, m.row1), Double2.Dot(v, m.row2)); } /// <summary> /// * 运算 /// </summary> /// <param name="obj"></param> /// <returns></returns> public override bool Equals(System.Object obj) { if (obj == null) { return false; } Matrix2x2 p = (Matrix2x2)obj; if ((System.Object)p == null) { return false; } return (col1 == p.col1) && (col2 == p.col2); } /// <summary> /// /// </summary> /// <returns></returns> public override int GetHashCode() { return base.GetHashCode(); } /// <summary> /// 转置矩阵 /// </summary> /// <param name="k"></param> /// <param name="vector"></param> /// <returns></returns> public Matrix2x2 GetT() { return new Matrix2x2(this.row1, this.row2); } /// <summary> /// 转置矩阵 /// </summary> /// <param name="k"></param> /// <param name="vector"></param> /// <returns></returns> public static Matrix2x2 T(Matrix2x2 v) { return new Matrix2x2(v.row1, v.row2); } /// <summary> /// 计算协方差举证 /// https://zhuanlan.zhihu.com/p/37609917 /// </summary> /// <param name="points"></param> /// <returns></returns> public static Matrix2x2 GetCovarianceMatrix(Double2[] points) { Matrix2x2 covarianceMatrix = Matrix2x2.zero; if (points == null || points.Length <= 0) return covarianceMatrix; int numPoints = points.Length; //Compute the covariance for (int col = 0; col < 2; col++) { Double2 data; for (int row = col; row < 2; row++) { covarianceMatrix[col, row] = 0.0f; Double acc = 0.0f; //cov(X,Y)=E[(X-x)(Y-y)] for (int i = 0; i < numPoints; i++) { data = points[i]; acc += data[col] * data[row]; } acc /= numPoints; covarianceMatrix[col, row] = acc; //symmetric covarianceMatrix[row, col] = acc; } } return covarianceMatrix; } /// <summary> /// 求特征向量矩阵 通过使用Jacobi 迭代算法 /// </summary> /// <param name="matrix"></param> public static Matrix2x2 GetFeatureVectorMatrix(Matrix2x2 matrix) { double p, q, spq; double cosa, sina; //cos(alpha) and sin(alpha) double temp; double s1 = 0.0f; //sums of squares of diagonal double s2; //elements bool flag = true; //determine whether to iterate again int iteration = 0; //iteration counter double[] data = new double[2]; Matrix2x2 t = Matrix2x2.one;//To store the product of the rotation matrices. do { iteration++; for (int i = 0; i < 2; i++) { for (int j = i + 1; j < 2; j++) { if (System.Math.Abs(matrix[j, i]) < MathUtil.kEpsilon) matrix[j, i] = 0.0f; else { q = System.Math.Abs(matrix[i, i] - matrix[j, j]); if (q > MathUtil.kEpsilon) { p = (2.0f * matrix[j, i] * q) / (matrix[i, i] - matrix[j, j]); spq = (float)System.Math.Sqrt(p * p + q * q); cosa = (float)System.Math.Sqrt((1.0f + q / spq) / 2.0f); sina = p / (2.0f * cosa * spq); } else sina = cosa = (float)System.Math.Sqrt(2) * 0.5f; for (int k = 0; k < 2; k++) { temp = t[i, k]; t[i, k] = (temp * cosa + t[j, k] * sina); t[j, k] = (temp * sina - t[j, k] * cosa); } for (int k = i; k < 2; k++) { if (k > j) { temp = matrix[k, i]; matrix[k, i] = (cosa * temp + sina * matrix[k, j]); matrix[k, j] = (sina * temp - cosa * matrix[k, j]); } else { data[k] = matrix[k, i]; matrix[k, i] = (cosa * data[k] + sina * matrix[j, k]); if (k == j) matrix[k, j] = (sina * data[k] - cosa * matrix[k, j]); } } data[j] = sina * data[i] - cosa * data[j]; for (int k = 0; k <= j; k++) { if (k <= i) { temp = matrix[i, k]; matrix[i, k] = (cosa * temp + sina * matrix[j, k]); matrix[j, k] = (sina * temp - cosa * matrix[j, k]); } else matrix[j, k] = (sina * data[k] - cosa * matrix[j, k]); } } } } s2 = 0.0f; for (int i = 0; i < 2; i++) { s2 += matrix[i, i] * matrix[i, i]; } if (System.Math.Abs(s2) < MathUtil.kEpsilon || System.Math.Abs(1 - s1 / s2) < MathUtil.kEpsilon) flag = false; else s1 = s2; } while (flag); return t; } } } ======================= File: Assets/Scripts/Graphics/Math/Matrix3x3.cs ======================= /// <summary> /// 矩阵 /// </summary> namespace RayGraphics.Math { public class Matrix3x3 { /// <summary> /// 第一行 /// </summary> public Double3 col1; /// <summary> /// 第二行 /// </summary> public Double3 col2; /// <summary> /// 第三行 /// </summary> public Double3 col3; /// <summary> /// 第一列 /// </summary> public Double3 row1 { get { return new Double3(col1.x, col2.x, col3.x); } } /// <summary> /// 第二列 /// </summary> public Double3 row2 { get { return new Double3(col1.y, col2.y, col3.y); } } /// <summary> /// 第二列 /// </summary> public Double3 row3 { get { return new Double3(col1.z, col2.z, col3.z); } } /// <summary> /// 索引访问 /// </summary> /// <param name="col"></param> /// <param name="row"></param> /// <returns></returns> public double this[int col, int row] { get { if (col == 0) return this.col1[row]; else if (col == 1) return this.col2[row]; else if (col == 2) return this.col3[row]; else return 0; } set { if (col == 0) this.col1[row] = value; else if (col == 1) this.col2[row] = value; else if (col == 2) this.col3[row] = value; } } /// <summary> /// /// </summary> /// <param name="col1"></param> /// <param name="col2"></param> public Matrix3x3(Double3 col1, Double3 col2, Double3 col3) { this.col1 = col1; this.col2 = col2; this.col3 = col3; } /// <summary> /// /// </summary> /// <param name="col1"></param> /// <param name="col2"></param> /// <param name="col3"></param> public void Set(Double3 col1, Double3 col2, Double3 col3) { this.col1 = col1; this.col2 = col2; this.col3 = col3; } /// <summary> /// 0 矩阵 /// </summary> public static Matrix3x3 zero { get { return s_zero; } } private static readonly Matrix3x3 s_zero = new Matrix3x3(Double3.zero, Double3.zero, Double3.zero); /// <summary> /// 单位矩阵 /// </summary> public static Matrix3x3 one { get { return s_one; } } private static readonly Matrix3x3 s_one = new Matrix3x3(Double3.right, Double3.up, Double3.foward); /// <summary> /// 绕Z旋转 /// </summary> /// <param name="angle"></param> /// <returns></returns> public static Matrix3x3 RotateZMatrix(double angle) { double cosAngle = MathFunc.cosAngle(angle); double sinAngle = MathFunc.sinAngle(angle); Double3 col1 = new Double3(cosAngle, sinAngle, 0); Double3 col2 = new Double3(-sinAngle, cosAngle, 0); Double3 col3 = new Double3(0, 0, 1); return new Matrix3x3(col1, col2, col3); } /// <summary> /// 绕X旋转 /// </summary> /// <param name="angle"></param> /// <returns></returns> public static Matrix3x3 RotateXMatrix(double angle) { double cosAngle = System.Math.Cos(angle); double sinAngle = System.Math.Sin(angle); Double3 col1 = new Double3(1, 0, 0); Double3 col2 = new Double3(0, cosAngle, sinAngle); Double3 col3 = new Double3(0, -sinAngle, cosAngle); return new Matrix3x3(col1, col2, col3); } /// <summary> /// 绕轴旋转 /// </summary> /// <param name="axis">轴的法向量</param> /// <param name="angle">旋转角度</param> /// <returns></returns> public static Matrix3x3 RotateMatrix(Double3 axis,double angle) { double cosAngle = MathFunc.cosAngle(angle); double sinAngle = MathFunc.sinAngle(angle); double nxCosAngleDiff = axis.x * (1- cosAngle); double nyCosAngleDiff = axis.y * (1 - cosAngle); double nzCosAngleDiff = axis.z * (1 - cosAngle); double nxSinAngle = axis.x * sinAngle; double nySinAngle = axis.y * sinAngle; double nzSinAngle = axis.z * sinAngle; Double3 col1 = new Double3(axis.x * nxCosAngleDiff + cosAngle, axis.x * nyCosAngleDiff + nzSinAngle, axis.x * nzCosAngleDiff - nySinAngle); Double3 col2 = new Double3(axis.y * nxCosAngleDiff - nzSinAngle, axis.y * nyCosAngleDiff + cosAngle, axis.y * nzCosAngleDiff + nxSinAngle); Double3 col3 = new Double3(axis.z * nxCosAngleDiff + nySinAngle, axis.z * nyCosAngleDiff - nxSinAngle, axis.z * nzCosAngleDiff + cosAngle); return new Matrix3x3(col1, col2, col3); } /// <summary> /// 绕Y旋转 /// </summary> /// <param name="angle"></param> /// <returns></returns> public static Matrix3x3 RotateYMatrix(double angle) { double cosAngle = MathFunc.cosAngle(angle); double sinAngle = MathFunc.sinAngle(angle); Double3 col1 = new Double3(cosAngle, 0, sinAngle); Double3 col2 = new Double3(0, 1, 0); Double3 col3 = new Double3(-sinAngle, 0, cosAngle); return new Matrix3x3(col1, col2, col3); } /// <summary> /// 缩放矩阵 /// </summary> /// <param name="scaleX"></param> /// <param name="scaleY"></param> /// <returns></returns> public static Matrix3x3 ScaleMatrix(float scaleX, float scaleY, float scaleZ) { Double3 col1 = scaleX * Double3.right; Double3 col2 = scaleY * Double3.up; Double3 col3 = scaleZ * Double3.foward; return new Matrix3x3(col1, col2, col3); } /// <summary> /// 缩放矩阵 /// </summary> /// <param name="scale"></param> /// <returns></returns> public static Matrix3x3 ScaleMatrix(float scale) { Double3 col1 = scale * Double3.right; Double3 col2 = scale * Double3.up; Double3 col3 = scale * Double3.foward; return new Matrix3x3(col1, col2, col3); } /// <summary> /// 沿着指定轴进行缩放 /// </summary> /// <param name="axis">指定轴的法向量</param> /// <param name="scale">缩放比例</param> /// <returns></returns> public static Matrix3x3 ScaleMatrix(Double3 axis, float scale) { double dx = (scale - 1) * axis.x; double dy = (scale - 1) * axis.y; double dz = (scale - 1) * axis.z; Double3 col1 = new Double3(1+ dx * axis.x, dx * axis.y, dx * axis.y); Double3 col2 = new Double3(dy * axis.x, 1 + dy * axis.y, dy * axis.z); Double3 col3 = new Double3(dz * axis.x, dz * axis.y, 1 + dz * axis.z); return new Matrix3x3(col1, col2, col3); } /// <summary> /// 投影到XY平面的正交投影矩阵 /// </summary> /// <returns></returns> public static Matrix3x3 XYOrthogonalProjectionMatrix() { Double3 col1 = Double3.right; Double3 col2 = Double3.up; Double3 col3 = Double3.zero; return new Matrix3x3(col1, col2, col3); } /// <summary> /// 投影到XZ平面的正交投影矩阵 /// </summary> /// <returns></returns> public static Matrix3x3 XZOrthogonalProjectionMatrix() { Double3 col1 = Double3.right; Double3 col2 = Double3.zero; Double3 col3 = Double3.foward; return new Matrix3x3(col1, col2, col3); } /// <summary> /// 投影到XZ平面的正交投影矩阵 /// </summary> /// <returns></returns> public static Matrix3x3 YZOrthogonalProjectionMatrix() { Double3 col1 = Double3.zero; Double3 col2 = Double3.up; Double3 col3 = Double3.foward; return new Matrix3x3(col1, col2, col3); } /// <summary> /// 矩阵判断相等 /// </summary> /// <param name="v1"></param> /// <param name="v2"></param> /// <returns></returns> public static bool operator!=(Matrix3x3 v1, Matrix3x3 v2) { return v1.col1!= v2.col1 || v1.col2!= v2.col2 || v1.col3!= v2.col3; } /// <summary> /// 矩阵判断相等 /// </summary> /// <param name="v1"></param> /// <param name="v2"></param> /// <returns></returns> public static bool operator ==(Matrix3x3 v1, Matrix3x3 v2) { return v1.col1 == v2.col1 && v1.col2 == v2.col2 && v1.col3 == v2.col3; } /// <summary> /// 矩阵+ /// </summary> /// <param name="v1"></param> /// <param name="v2"></param> /// <returns></returns> public static Matrix3x3 operator +(Matrix3x3 v1, Matrix3x3 v2) { Double3 m1 = v1.col1 + v2.col1; Double3 m2 = v1.col2 + v2.col2; Double3 m3 = v1.col3 + v2.col3; return new Matrix3x3(m1, m2, m3); } /// <summary> /// 矩阵- /// </summary> /// <param name="v1"></param> /// <param name="v2"></param> /// <returns></returns> public static Matrix3x3 operator -(Matrix3x3 v1, Matrix3x3 v2) { Double3 m1 = v1.col1 - v2.col1; Double3 m2 = v1.col2 - v2.col2; Double3 m3 = v1.col3 - v2.col3; return new Matrix3x3(m1, m2, m3); } /// <summary> /// * 运算 /// </summary> /// <param name="k"></param> /// <param name="vector"></param> /// <returns></returns> public static Matrix3x3 operator *(double k, Matrix3x3 v) { Double3 col1 = v.col1 * k; Double3 col2 = v.col2 * k; Double3 col3 = v.col3 * k; return new Matrix3x3(col1, col2, col3); } /// <summary> /// * 运算 /// </summary> /// <param name="k"></param> /// <param name="vector"></param> /// <returns></returns> public static Matrix3x3 operator *(Matrix3x3 v, double k) { Double3 col1 = v.col1 * k; Double3 col2 = v.col2 * k; Double3 col3 = v.col3 * k; return new Matrix3x3(col1, col2, col3); } /// <summary> /// * 运算 /// </summary> /// <param name="m1"></param> /// <param name="m2"></param> /// <returns></returns> public static Matrix3x3 operator *(Matrix3x3 m1, Matrix3x3 m2) { Double3 col1 = new Double3(Double3.Dot(m1.col1, m2.row1), Double3.Dot(m1.col1, m2.row2), Double3.Dot(m1.col1, m2.row3)); Double3 col2 = new Double3(Double3.Dot(m1.col2, m2.row1), Double3.Dot(m1.col2, m2.row2), Double3.Dot(m1.col2, m2.row3)); Double3 col3 = new Double3(Double3.Dot(m1.col3, m2.row1), Double3.Dot(m1.col3, m2.row2), Double3.Dot(m1.col3, m2.row3)); return new Matrix3x3(col1, col2, col3); } /// <summary> /// * 运算 /// </summary> /// <param name="m1"></param> /// <param name="m2"></param> /// <returns></returns> public static Double3 operator *(Matrix3x3 m, Double3 v) { return new Double3(Double3.Dot(m.col1, v), Double3.Dot(m.col2, v), Double3.Dot(m.col3, v)); } /// <summary> /// * 运算 /// </summary> /// <param name="m1"></param> /// <param name="m2"></param> /// <returns></returns> public static Double3 operator *(Double3 v, Matrix3x3 m) { return new Double3(Double3.Dot(v, m.row1), Double3.Dot(v, m.row2), Double3.Dot(v, m.row3)); } /// <summary> /// * 运算 /// </summary> /// <param name="obj"></param> /// <returns></returns> public override bool Equals(System.Object obj) { if (obj == null) { return false; } Matrix3x3 p = (Matrix3x3)obj; if ((System.Object)p == null) { return false; } return (col1 == p.col1) && (col2 == p.col2) && (col3 == p.col3); } /// <summary> /// /// </summary> /// <returns></returns> public override int GetHashCode() { return base.GetHashCode(); } /// <summary> /// 转置矩阵 /// </summary> /// <param name="k"></param> /// <param name="vector"></param> /// <returns></returns> public Matrix3x3 GetT() { return new Matrix3x3(this.row1, this.row2, this.row3); } /// <summary> /// 转置矩阵 /// </summary> /// <param name="k"></param> /// <param name="vector"></param> /// <returns></returns> public static Matrix3x3 T(Matrix3x3 v) { return new Matrix3x3(v.row1, v.row2, v.row3); } } } ======================= File: Assets/Scripts/Voxelization/Contour/ContourUnit.cs ======================= <gh_stars>0 using RayGraphics.Math; using System.Collections.Generic; namespace RayGraphics.Voxelization { [System.Serializable] public class ContourUnit { public ContourUnit() { } public ContourUnit(ContourPoly outPoly) { OutPoly = outPoly; } /// <summary> /// out 多边形 /// </summary> public ContourPoly OutPoly = new ContourPoly(); /// <summary> /// block 多边形 /// </summary> public List<ContourPoly> blockPolys = new List<ContourPoly>(); /// <summary> /// 只有关卡又这个数据 /// </summary> public DoorData minDoor = null; public DoorData maxDoor = null; /// <summary> /// 设置关卡地图door的数据 /// </summary> /// <param name="minDoorPos"></param> /// <param name="maxDoorPos"></param> /// <param name="isXdir"></param> /// <param name="TileSize"></param> /// <param name="stageMapIndex"></param> public void SetDoorData(Float2 minDoorPos, Float2 maxDoorPos, bool isXdir, float TileSize, int stageMapIndex) { this.minDoor = new DoorData(); this.minDoor.Init(minDoorPos, isXdir, TileSize, false); this.minDoor.linkStageMapID = stageMapIndex; // this.maxDoor = new DoorData(); this.maxDoor.Init(maxDoorPos, isXdir, TileSize, true); this.maxDoor.linkStageMapID = stageMapIndex; } /// <summary> /// 判断点是否在轮廓里面 /// </summary> /// <param name="pos"></param> /// <returns></returns> public bool CheckIn(Float2 pos) { return OutPoly.CheckIn(pos); } /// <summary> /// 添加挡格轮廓多边形 /// </summary> /// <param name="unit"></param> public void AddBlockPoly(ContourPoly poly) { if (poly == null) return; blockPolys.Add(poly); } public void Clear() { OutPoly.Clear(); foreach (ContourPoly poly in blockPolys) { poly.Clear(); } blockPolys.Clear(); } } [System.Serializable] public class DoorData { public DoorData() { } public DoorData(DoorData v) { this.ID = v.ID; this.centerPos = v.centerPos; this.InAraaMapPos = v.InAraaMapPos; this.InStageMapPos = v.InStageMapPos; this.linkAreaMapID = v.linkAreaMapID; this.linkStageMapID = v.linkStageMapID; } public DoorData(DoorData v, int newID) { this.ID = newID; this.centerPos = v.centerPos; this.InAraaMapPos = v.InAraaMapPos; this.InStageMapPos = v.InStageMapPos; this.linkAreaMapID = v.linkAreaMapID; this.linkStageMapID = v.linkStageMapID; } public int ID; /// <summary> /// 只有关卡又这个数据 /// </summary> public Float2 centerPos; public Float2 InAraaMapPos; public Float2 InStageMapPos; public int linkStageMapID; public int linkAreaMapID; public void Init(Float2 pos, bool isXdir, float TileSize, bool isMax) { float step = TileSize * 2; this.centerPos = pos; if (isXdir == true) { if (isMax == false) { this.InAraaMapPos = this.centerPos - Float2.right * step; this.InStageMapPos = this.centerPos + Float2.right * step; } else { this.InAraaMapPos = this.centerPos + Float2.right * step; this.InStageMapPos = this.centerPos - Float2.right * step; } } else { if (isMax == false) { this.InAraaMapPos = this.centerPos - Float2.up * step; this.InStageMapPos = this.centerPos + Float2.up * step; } else { this.InAraaMapPos = this.centerPos + Float2.up * step; this.InStageMapPos = this.centerPos - Float2.up * step; } } } } } ======================= File: Assets/Scripts/Graphics/Geometric/RayPath/RayPathOptimization.cs ======================= <reponame>741645596/graph<filename>Assets/Scripts/Graphics/Geometric/RayPath/RayPathOptimization.cs using System.Collections.Generic; using RayGraphics.Math; namespace RayGraphics.Geometric { public class RayPathOptimization { /// <summary> /// 优化路线 /// </summary> /// <param name="lineStart">线段起点</param> /// <param name="lineEnd">线段终点</param> /// <param name="near">与动态挡格相交 near点</param> /// <param name="far">与动态挡格相交 far点</param> /// <param name="listMidPoint">2个交点之间的路线</param> /// <returns></returns> public static List<Double2> OptimizationLine(Double2 lineStart, Double2 lineEnd, Double2 near, Double2 far, bool isCounterclockwiseDir, List<Double2> listMidPoint) { if (listMidPoint == null || listMidPoint.Count == 0) return listMidPoint; /* #if UNITY_EDITOR List<Float2> l = new List<Float2>(); l.Add(near); l.AddRange(listMidPoint); l.Add(far); SkillObb.instance.TargetPoly = l.ToArray(); #endif */ List<Double2> listOptimizationLine = listMidPoint; // 先顺序来一次优化 Double2 outdir = (lineEnd - lineStart).normalized; if (isCounterclockwiseDir == false) { outdir = Double2.Rotate(outdir, MathUtil.kPI - MathUtil.kEpsilon); } else { outdir = Double2.Rotate(outdir, -MathUtil.kPI + MathUtil.kEpsilon); } listOptimizationLine = SearchOutPoint(lineStart, far, outdir.normalized, listOptimizationLine); // 再倒序来一次优化 listOptimizationLine.Reverse(); outdir = (lineStart - lineEnd).normalized; if (isCounterclockwiseDir == true) { outdir = Double2.Rotate(outdir, MathUtil.kPI - MathUtil.kEpsilon); } else { outdir = Double2.Rotate(outdir, -MathUtil.kPI + MathUtil.kEpsilon); } listOptimizationLine = SearchOutPoint(lineEnd, near, outdir.normalized, listOptimizationLine); listOptimizationLine.Reverse(); // return listOptimizationLine; } /// <summary> /// 获取最边缘一圈的顶点。 /// </summary> /// <param name="lineStart">起点</param> /// <param name="far">远处的交点</param> /// <param name="outdir">外包边</param> /// <param name="listOutEdgePoint"></param> /// <returns></returns> private static List<Double2> SearchOutPoint(Double2 lineStart, Double2 far, Double2 outdir, List<Double2> listOutEdgePoint) { if (listOutEdgePoint == null || listOutEdgePoint.Count == 0) return listOutEdgePoint; // 开始搜寻了。 List<Double2> lResult = new List<Double2>(); Double2 startPoint = lineStart; Double2 bestPoint = Double2.zero; Double2 indir = far - lineStart; bool isHaveBestPoint = false; List<Double2> listinPoints = new List<Double2>(); List<Double2> lHave = listOutEdgePoint; while (lHave!= null && lHave.Count > 0) { // 先过滤了。 foreach (Double2 pos in lHave) { if (CheckPointInCorns(pos, startPoint, indir, outdir) == true) { listinPoints.Add(pos); if (isHaveBestPoint == false) { bestPoint = pos; isHaveBestPoint = true; } } } // 再则优。 if (isHaveBestPoint == true) { for (int i = 1; i < listinPoints.Count; i++) { // 比较更好的点。 if (CheckPointInCorns(listinPoints[i], startPoint, bestPoint - startPoint, outdir) == true) { bestPoint = listinPoints[i]; } } // 进行交换,执行下一轮迭代。 lResult.Add(bestPoint); outdir = (bestPoint - startPoint).normalized; startPoint = bestPoint; indir = far - startPoint; listinPoints.Remove(bestPoint); lHave = listinPoints; listinPoints = new List<Double2>(); isHaveBestPoint = false; } else break; } return lResult; } /// <summary> /// 判断指定的点,在夹角内。不包括在边上。 /// </summary> /// <param name="target"></param> /// <param name="startPoint"></param> /// <param name="indir"></param> /// <param name="outdir"></param> /// <returns></returns> private static bool CheckPointInCorns(Double2 target, Double2 startPoint, Double2 indir, Double2 outdir) { Double2 diff = target - startPoint; if (diff == Double2.zero) return false; double ret = Double2.Cross(outdir, diff) * Double2.Cross(indir.normalized, diff); if (ret < 0) { // 添加异常处理,防止在反方向 /*if (Float2.Dot(diff, indir.normalized + outdir) < 0) return false; else return true;*/ return true; } else if (ret == 0) { if (Double2.Dot(diff, indir) <= 0) return false; if (indir.sqrMagnitude < diff.sqrMagnitude) return true; else return false; } return false; } } } ======================= File: Assets/Scripts/Graphics/Triangulation2D/SweepLineStatus.cs ======================= <gh_stars>0 using RayGraphics.Math; using System.Collections.Generic; namespace RayGraphics.Triangulation { /// <summary> /// 扫描线状态结构 /// 维持一个梯形列表 /// </summary> public class SweepLineStatus { /// <summary> /// 梯形列表 /// </summary> private List<Trapezoid> listTrap = new List<Trapezoid>(); /// <summary> /// 清理工作 /// </summary> public void Clear() { this.listTrap.Clear(); } private void Print() { UnityEngine.Debug.Log("next:" + listTrap.Count); foreach (Trapezoid v in listTrap) { v.Print(); } } /// <summary> /// 更新扫描线,更新扫描线状态 /// </summary> /// <param name="sl">扫描线结构</param> /// <param name="listDiagonal"></param> /// <param name="parent">父对象</param> /// <param name="isYdown">扫描方向 true y从大到小扫描,否则从小到到大扫描</param> public void UpdatePoints(ScanLine sl, ref List<Index2> listDiagonal, PolygonChain parent, bool isYdown) { // 先创建独立梯形 Trapezoid left = null; Trapezoid right = null; foreach (VertexInfo ScanPoints in sl.LinePoints) { // 定位到分割点了 if (ScanPoints.CheckSplitPoint(isYdown)) { int retIndex = -1; Trapezoid targetTrap = FindCheckInTrapezoid(ScanPoints, isYdown, ref retIndex); if (targetTrap!= null) { if (targetTrap.helper.pos.y!= ScanPoints.pos.y) // 过滤掉这种特殊情况 { listDiagonal.Add(new Index2(targetTrap.helper.fixIndex, ScanPoints.fixIndex)); } // 进行分割梯形为2 Trapezoid leftTrap = new Trapezoid(targetTrap.left, ScanPoints.GetLeftEdge(parent), ScanPoints.GetLeftPoint()); Trapezoid rightTrap = new Trapezoid(ScanPoints.GetRightEdge(parent), targetTrap.right, ScanPoints.GetRightPoint()); bool isLeft =!leftTrap.CheckInvalid(); bool isRight =!rightTrap.CheckInvalid(); if (isLeft && isRight) { listTrap[retIndex] = leftTrap; listTrap.Insert(retIndex + 1, rightTrap); } else if (isLeft) { listTrap[retIndex] = leftTrap; } else if (isRight) { listTrap[retIndex] = rightTrap; } else { listTrap.RemoveAt(retIndex); } } else { AddTrapezoid(new Trapezoid(ScanPoints.GetLeftEdge(parent), ScanPoints.GetRightEdge(parent), ScanPoints.GetLeftPoint())); } } else { int retIndex = -1; bool ret = FindParent(ScanPoints, ref left, ref right, ref retIndex); if (ret == true) { if (left == right) { left.Growth(ScanPoints, parent); // 剔除退化的梯形 if (left.CheckInvalid() == true) { listTrap.RemoveAt(retIndex); } } else // 进行合并,剔除合并前的,新增合并后的 { listTrap[retIndex] = Trapezoid.CombineTrapezoid(left, right, ScanPoints); listTrap.RemoveAt(retIndex + 1); } } else { AddTrapezoid(new Trapezoid(ScanPoints.GetLeftEdge(parent), ScanPoints.GetRightEdge(parent), ScanPoints.GetLeftPoint())); } } } CullNoAreaTrapezoid(); //Print(); } /// <summary> /// 剔除无面积矩形 /// </summary> private void CullNoAreaTrapezoid() { for (int i = 0; i < listTrap.Count;) { if (listTrap[i].CheckNoArea() == true) { listTrap.RemoveAt(i); } else { i++; } } } /// <summary> /// 加入梯形 /// </summary> private void AddTrapezoid(Trapezoid v) { if (v == null) return; if (listTrap.Count == 0) { listTrap.Add(v); } else { BinaryInsert(v, 0, listTrap.Count - 1); } } /// <summary> /// 找老大,最多找到2个梯形 /// </summary> /// <param name="ScanPoints">扫描线点</param> /// <param name="left">左梯形</param> /// <param name="right">右梯形</param> /// <param name="retIndex">左梯形的索引</param> /// <returns></returns> private bool FindParent(VertexInfo ScanPoints, ref Trapezoid left, ref Trapezoid right, ref int retIndex) { left = null; right = null; retIndex = -1; int count = listTrap.Count; if (count == 0) { return false; } for (int i = 0; i < count; i++) { Trapezoid v = listTrap[i]; if (v.CheckInEdge(ScanPoints)!= null) { if (left == null) { left = v; retIndex = i; } else if (right == null) { right = v; } } } if (left == null && right == null) { return false; } else { if (right == null) { right = left; } return true; } } /// <summary> /// 二分查找 /// </summary> /// <param name="targetValue"></param> /// <param name="minIndex"></param> /// <param name="maxIndex"></param> /// <returns></returns> private void BinaryInsert(Trapezoid targetValue, int minIndex, int maxIndex) { while (minIndex <= maxIndex) { if (this.listTrap[minIndex].X <= targetValue.X && this.listTrap[maxIndex].X >= targetValue.X) { int middle = (minIndex + maxIndex) / 2; if (middle == minIndex) { this.listTrap.Insert(minIndex + 1, targetValue); return; } else { if (this.listTrap[middle].X <= targetValue.X) { minIndex = middle; } else { maxIndex = middle; } } } else if (this.listTrap[minIndex].X > targetValue.X) { this.listTrap.Insert(0, targetValue); return; } else { this.listTrap.Add(targetValue); return; } } } /// <summary> /// 查找到所在的梯形 /// </summary> /// <param name="ScanPoints">扫描线点</param> /// <returns></returns> private Trapezoid FindCheckInTrapezoid(VertexInfo ScanPoints, bool isYdown,ref int retIndex) { retIndex = -1; int count = listTrap.Count; for (int i = 0; i < count; i++) { Trapezoid v = listTrap[i]; if (v.CheckIn(ScanPoints, isYdown) == true) { retIndex = i; return v; } } return null; } } } ======================= File: Assets/Scripts/Graphics/Math/Float4.cs ======================= <reponame>741645596/graph<gh_stars>0 using System.Collections; using System.Collections.Generic; namespace RayGraphics.Math { public partial struct Float4 { public float x, y, z, w; /// <summary> /// /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <param name="z"></param> /// <param name="w"></param> public Float4(float x, float y, float z, float w) { this.x = x; this.y = y; this.z = z; this.w = w; } /// <summary> /// /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <param name="z"></param> /// <param name="w"></param> public Float4(double x, double y, double z, double w) { this.x = (float)x; this.y = (float)y; this.z = (float)z; this.w = (float)w; } /// <summary> /// 设置属性 /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <param name="z"></param> public void Set(float x, float y, float z, float w) { this.x = x; this.y = y; this.z = z; this.w = w; } /// <summary> /// 按索引访问 /// </summary> /// <param name="index"></param> /// <returns></returns> public float this[int index] { get { if (index == 0) return this.x; else if (index == 1) return this.y; else if (index == 2) return this.z; else if (index == 3) return this.w; else return 0; } set { if (index == 0) this.x = value; else if (index == 1) this.y = value; else if (index == 2) this.z = value; else if (index == 3) this.w = value; } } /// <summary> /// 0 /// </summary> private static readonly Float4 s_zero = new Float4(0, 0, 0, 0); public static Float4 zero { get { return s_zero; } } /// <summary> /// 单位向量 /// </summary> public static Float4 one { get { return s_one; } } private static readonly Float4 s_one = new Float4(1, 1, 1, 1); /// <summary> /// /// </summary> /// <param name="vector1"></param> /// <param name="vector2"></param> /// <returns></returns> public static bool operator!=(Float4 vector1, Float4 vector2) { return vector1.x!= vector2.x || vector1.y!= vector2.y || vector1.z!= vector2.z || vector1.w != vector2.w; } /// <summary> /// /// </summary> /// <param name="vector1"></param> /// <param name="vector2"></param> /// <returns></returns> public static bool operator ==(Float4 vector1, Float4 vector2) { return vector1.x == vector2.x && vector1.y == vector2.y && vector1.z == vector2.z && vector1.w == vector2.w; } /// <summary> /// /// </summary> /// <param name="vector1"></param> /// <param name="vector2"></param> /// <returns></returns> public static Float4 operator +(Float4 vector1, Float4 vector2) { float xx = vector1.x + vector2.x; float yy = vector1.y + vector2.y; float zz = vector1.z + vector2.z; float ww = vector1.w + vector2.w; return new Float4(xx, yy, zz, ww); } /// <summary> /// /// </summary> /// <param name="vector1"></param> /// <param name="vector2"></param> /// <returns></returns> public static Float4 operator -(Float4 vector1, Float4 vector2) { float xx = vector1.x - vector2.x; float yy = vector1.y - vector2.y; float zz = vector1.z - vector2.z; float ww = vector1.w - vector2.w; return new Float4(xx, yy, zz, ww); } /// <summary> /// /// </summary> /// <param name="k"></param> /// <param name="vector"></param> /// <returns></returns> public static Float4 operator *(float k, Float4 vector) { float xx = vector.x * k; float yy = vector.y * k; float zz = vector.z * k; float ww = vector.w * k; return new Float4(xx, yy, zz, ww); } /// <summary> /// /// </summary> /// <param name="vector"></param> /// <param name="k"></param> /// <returns></returns> public static Float4 operator *(Float4 vector, float k) { float xx = vector.x * k; float yy = vector.y * k; float zz = vector.z * k; float ww = vector.w * k; return new Float4(xx, yy, zz, ww); } public override bool Equals(System.Object obj) { if (obj == null) { return false; } Float4 p = (Float4)obj; if ((System.Object)p == null) { return false; } return (x == p.x) && (y == p.y) && (z == p.z) && (w == p.w); } public override int GetHashCode() { return base.GetHashCode(); } /// <summary> /// 点积 /// </summary> /// <param name="a"></param> /// <param name="b"></param> /// <returns></returns> public static float Dot(Float4 a, Float4 b) //点积 { return a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w; } } } ======================= File: Assets/Scripts/Graphics/Math/MathUtil.cs ======================= <gh_stars>0 using System; namespace RayGraphics.Math { public class MathUtil { /// <summary> /// 直角增加的IntegrationValue /// </summary> public static readonly double StraightDistance = 1.0f; /// <summary> /// 对角增加的IntegrationValue /// </summary> public static readonly double DiagonalDistance = 1.414214f; /// <summary> /// 误差 /// </summary> public const float kEpsilon = 1E-05F; /// <summary> /// 误差 /// </summary> public const float kEpsilonNormalSqrt = 1E-15F; /// <summary> /// pi 常量 /// </summary> public const float kPI = 3.14159265358979f; /// <summary> /// 获取2点评估距离/ 跳点距离 /// </summary> /// <param name="start"></param> /// <param name="end"></param> /// <returns></returns> public static double GetCompareDis(Double2 start, Double2 end) { Double2 diff = start - end; return diff.sqrMagnitude; } /// <summary> /// 获取2点评估距离/ 跳点距离 /// </summary> /// <param name="start"></param> /// <param name="end"></param> /// <returns></returns> public static double GetNearDistance(Double2 start, Double2 end) { Double2 diff = start - end; return GetNearDistance(diff); } /// <summary> /// 计算向量的长度 /// </summary> /// <param name="diff"></param> /// <returns></returns> public static double GetNearDistance(Double2 diff) { double dx = System.Math.Abs(diff.x); double dy = System.Math.Abs(diff.y); if (dy > dx) { return (dy - dx) * MathUtil.StraightDistance + dx * MathUtil.DiagonalDistance; } else { return (dx - dy) * MathUtil.StraightDistance + dy * MathUtil.DiagonalDistance; } } } /// <summary> /// 线关系 /// </summary> public enum LineRelation { /// <summary> /// 异常情况 /// </summary> None = 0, /// <summary> /// 重合 /// </summary> Coincide = 1, /// <summary> /// 平行 /// </summary> Parallel = 2, /// <summary> /// 相交 /// </summary> Intersect = 3, /// <summary> /// 分离 /// </summary> Detach = 4, } /// <summary> /// 多边形 /// </summary> public enum PolygonType { /// <summary> /// 凸多边形 /// </summary> Convex = 0, /// <summary> /// 凹多边形 /// </summary> Concave = 1, } /// <summary> /// 投影点在线上的关系 /// </summary> public enum ProjectPointInLine { /// <summary> /// 重合 /// </summary> OutStart = 0, /// <summary> /// 平行 /// </summary> In = 1, /// <summary> /// 相交 /// </summary> OutEnd = 2, } /// <summary> /// 射线包围盒返回类型 /// </summary> public enum RBIResultType { /// <summary> /// 失败 /// </summary> Fail = 0, /// <summary> /// 成功 /// </summary> Succ = 1, /// <summary> /// 通不过 /// </summary> UnCross = 2, /// <summary> /// 通不过 /// </summary> UnCrossstartPointIn = 3, /// <summary> /// 通不过 /// </summary> UnCrossendPointIn = 4, } } ======================= File: Assets/Scripts/Graphics/Geometric/3D/Rays3D.cs ======================= <filename>Assets/Scripts/Graphics/Geometric/3D/Rays3D.cs<gh_stars>0 using System.Collections; using System.Collections.Generic; using RayGraphics.Math; namespace RayGraphics.Geometric { /// <summary> /// 射线 /// </summary> public class Rays3D : Line3D { public Rays3D(Double3 startPt, Double3 dir) { this._startPoint = startPt; this._normalizedDir = dir.normalized; } /// <summary> /// 判断点是否在射线上 /// </summary> /// <param name="pt"></param> /// <returns></returns> public override bool CheckIn(Double3 pt) { bool ret = base.CheckIn(pt); if (ret == true) { Double3 diff = pt - this.StartPoint; if (Double3.Dot(diff, this.NormalizedDir) < 0) return false; else return true; } return false; } /// <summary> /// 点导视线的距离 /// </summary> /// <param name="pt"></param> /// <returns></returns> public override double CalcDistance(Double3 pt) { Double3 diff = pt - this.StartPoint; if (diff == Double3.zero) return 0; if (Double3.Dot(diff, this.NormalizedDir) <= 0) { return diff.magnitude; } else { Double3 verticalAxis = this.AixsVector(pt); return verticalAxis.magnitude; } } /// <summary> /// 与线的关系 /// </summary> /// <param name="line"></param> /// <returns></returns> public override LineRelation CheckLineRelation(Line3D line) { LineRelation lr = base.CheckLineRelation(line); if (lr == LineRelation.Intersect) { Double3 aixsVector = line.AixsVector(this.StartPoint); if (Double3.Dot(aixsVector, this.NormalizedDir) > 0) { return LineRelation.Detach; } else { return LineRelation.Intersect; } } else { return lr; } } /// <summary> /// 获取交点 /// </summary> /// <param name="line"></param> /// <param name="intersectPoint"></param> /// <returns></returns> public override bool GetIntersectPoint(Line3D line, ref Double3 intersectPoint) { Double3 point = Double3.zero; if (base.GetIntersectPoint(line, ref point) == true) { if (Double3.Dot(line.NormalizedDir, point - line.StartPoint) >= 0) { intersectPoint = point; return true; } else { return false; } } return false; } } } ======================= File: Assets/Scripts/Graphics/Geometric/2D/iGeo2DElement.cs ======================= <reponame>741645596/graph using RayGraphics.Math; namespace RayGraphics.Geometric { public interface iGeo2DElement { /// <summary> /// 判断点是否在几何元素上 /// </summary> /// <param name="pt"></param> /// <returns></returns> bool CheckIn(Double2 pt); /// <summary> /// 点导几何元素的距离 /// </summary> /// <param name="pt"></param> /// <returns></returns> double CalcDistance(Double2 pt); /// <summary> /// 点导几何元素的投影点 /// </summary> /// <param name="pt"></param> /// <returns></returns> Double2 ProjectPoint(Double2 pt); /// <summary> /// 点到几何元素轴向量(垂直),交点-》pt /// </summary> /// <param name="pt"></param> /// <returns></returns> Double2 AixsVector(Double2 pt); /// <summary> /// 与直线的关系 /// </summary> /// <param name="line"></param> /// <returns></returns> LineRelation CheckLineRelation(Line2D line); /// <summary> /// 与射线的关系 /// </summary> /// <param name="line"></param> /// <returns></returns> LineRelation CheckLineRelation(Rays2D line); /// <summary> /// 与线段的关系 /// </summary> /// <param name="line"></param> /// <returns></returns> LineRelation CheckLineRelation(LineSegment2D line); /// <summary> /// 获取交点 /// </summary> /// <param name="line"></param> /// <param name="intersectPoint"></param> /// <returns></returns> bool GetIntersectPoint(Line2D line, ref Double2 intersectPoint); /// <summary> /// 获取交点 /// </summary> /// <param name="line"></param> /// <param name="intersectPoint"></param> /// <returns></returns> bool GetIntersectPoint(Rays2D line, ref Double2 intersectPoint); /// <summary> /// 获取交点 /// </summary> /// <param name="line"></param> /// <param name="intersectPoint"></param> /// <returns></returns> bool GetIntersectPoint(LineSegment2D line, ref Double2 intersectStartPoint, ref Double2 intersectEndPoint); /// <summary> /// 镜面但 /// </summary> /// <param name="point"></param> /// <returns></returns> Double2 GetMirrorPoint(Double2 point); #if Client /// <summary> /// draw /// </summary> void Draw(); /// <summary> /// DrawGizmos /// </summary> void DrawGizmos(); #endif } } ======================= File: Assets/Scripts/Graphics/Tree/Bvh.cs ======================= using System.Collections.Generic; using RayGraphics.Math; namespace RayGraphics.Tree { /// <summary> /// bounding volume hierarchy 层次包围盒 /// </summary> public class Bvh : Itree { public void BuildTree(Double2 min, Double2 max, List<TreeData> listData) { } } } ======================= File: Assets/Scripts/Graphics/Geometric/RayPath/RayPathOptimization1.cs ======================= using System.Collections.Generic; using RayGraphics.Math; namespace RayGraphics.Geometric { /// <summary> /// bake 版本 /// </summary> public class RayPathOptimization1 { /// <summary> /// 优化路线 /// </summary> /// <param name="lineStart">线段起点</param> /// <param name="lineEnd">线段终点</param> /// <param name="near">与动态挡格相交 near点</param> /// <param name="far">与动态挡格相交 far点</param> /// <param name="listMidPoint">2个交点之间的路线</param> /// <returns></returns> public static List<Double2> OptimizationLine(Double2 lineStart, Double2 lineEnd, Double2 near, Double2 far, bool isCounterclockwiseDir, List<Double2> listMidPoint) { List<Double2> listResult = new List<Double2>(); if (listMidPoint == null || listMidPoint.Count == 0) return listResult; int nearestIndex = -1; int farestIndex = -1; CalcNearFarest(lineStart, lineEnd,listMidPoint, ref nearestIndex, ref farestIndex); if (nearestIndex >= 0 && nearestIndex < listMidPoint.Count) { Double2 nearPoint = listMidPoint[nearestIndex]; // step1 List<Double2> list = new List<Double2>(); for (int i = 0; i < nearestIndex; i++) { list.Add(listMidPoint[i]); } list = OptimizationStepLine(lineStart, nearPoint, lineStart, nearPoint, isCounterclockwiseDir, list); if (list!= null && list.Count > 0) { listResult.AddRange(list); } // listResult.Add(nearPoint); if (farestIndex == -1 || farestIndex <= nearestIndex || farestIndex >= listMidPoint.Count) { list = new List<Double2>(); for (int i = nearestIndex + 1; i < listMidPoint.Count; i++) { list.Add(listMidPoint[i]); } list = OptimizationStepLine(nearPoint, lineEnd, nearPoint, lineEnd, isCounterclockwiseDir, list); if (list!= null && list.Count > 0) { listResult.AddRange(list); } } else { Double2 farPoint = listMidPoint[farestIndex]; list = new List<Double2>(); for (int i = nearestIndex + 1; i < farestIndex; i++) { list.Add(listMidPoint[i]); } list = OptimizationStepLine(nearPoint, farPoint, nearPoint, farPoint, isCounterclockwiseDir, list); if (list!= null && list.Count > 0) { listResult.AddRange(list); } listResult.Add(farPoint); // step3 list = new List<Double2>(); for (int i = farestIndex + 1; i < listMidPoint.Count; i++) { list.Add(listMidPoint[i]); } list = OptimizationStepLine(farPoint, lineEnd, farPoint, lineEnd, isCounterclockwiseDir, list); if (list!= null && list.Count > 0) { listResult.AddRange(list); } } } else { if (farestIndex >= 0 && farestIndex <= listMidPoint.Count - 1) { Double2 keyPoint = listMidPoint[farestIndex]; // step1 List<Double2> list = new List<Double2>(); for (int i = 0; i < farestIndex; i++) { list.Add(listMidPoint[i]); } list = OptimizationStepLine(lineStart, keyPoint, near, keyPoint, isCounterclockwiseDir, list); if (list!= null && list.Count > 0) { listResult.AddRange(list); } // listResult.Add(keyPoint); // step2 list = new List<Double2>(); for (int i = farestIndex + 1; i < listMidPoint.Count; i++) { list.Add(listMidPoint[i]); } list = OptimizationStepLine(keyPoint, lineEnd, keyPoint, lineEnd, isCounterclockwiseDir, list); if (list!= null && list.Count > 0) { listResult.AddRange(list); } } else { listResult = OptimizationStepLine(lineStart, lineEnd, lineStart, lineEnd, isCounterclockwiseDir, listMidPoint); } } return listResult; } private static List<Double2> OptimizationStepLine(Double2 lineStart, Double2 lineEnd, Double2 near, Double2 far, bool isCounterclockwiseDir, List<Double2> listMidPoint) { if (listMidPoint == null || listMidPoint.Count == 0) return listMidPoint; List<Double2> listOptimizationLine = listMidPoint; // 先顺序来一次优化 Double2 outdir = (lineEnd - lineStart).normalized; if (isCounterclockwiseDir == false) { outdir = Double2.Rotate(outdir, MathUtil.kPI - MathUtil.kEpsilon); } else { outdir = Double2.Rotate(outdir, -MathUtil.kPI + MathUtil.kEpsilon); } listOptimizationLine = SearchOutPoint(lineStart, far, outdir.normalized, listOptimizationLine); // 再倒序来一次优化 outdir = (lineStart - lineEnd).normalized; if (isCounterclockwiseDir == true) { outdir = Double2.Rotate(outdir, MathUtil.kPI - MathUtil.kEpsilon); } else { outdir = Double2.Rotate(outdir, -MathUtil.kPI + MathUtil.kEpsilon); } listOptimizationLine.Reverse(); listOptimizationLine = SearchOutPoint(lineEnd, near, outdir.normalized, listOptimizationLine); listOptimizationLine.Reverse(); // return listOptimizationLine; } /// <summary> /// 获取最边缘一圈的顶点。 /// </summary> /// <param name="lineStart">起点</param> /// <param name="far">远处的交点</param> /// <param name="outdir">外包边</param> /// <param name="listOutEdgePoint"></param> /// <returns></returns> private static List<Double2> SearchOutPoint(Double2 lineStart, Double2 far, Double2 outdir, List<Double2> listOutEdgePoint) { if (listOutEdgePoint == null || listOutEdgePoint.Count == 0) return listOutEdgePoint; // 开始搜寻了。 List<Double2> lResult = new List<Double2>(); Double2 startPoint = lineStart; Double2 bestPoint = Double2.zero; Double2 indir = far - lineStart; bool isHaveBestPoint = false; List<Double2> listinPoints = new List<Double2>(); List<Double2> lHave = listOutEdgePoint; while (lHave!= null && lHave.Count > 0) { //SkillObb.instance.AdddirData(startPoint, outdir, indir); // 先过滤了。 for (int i = 0; i < lHave.Count; i++) { Double2 pos = lHave[i]; if (Double2.CheckPointInCorns(pos, startPoint, indir, outdir) == true) { bestPoint = pos; isHaveBestPoint = true; for (int k = i; k < lHave.Count; k++) { listinPoints.Add(lHave[k]); } break; } } // 再则优。 if (isHaveBestPoint == true) { for (int i = 1; i < listinPoints.Count; i++) { // 比较更好的点。 if (Double2.CheckPointInCorns(listinPoints[i], startPoint, bestPoint - startPoint, outdir) == true) { bestPoint = listinPoints[i]; } } // 进行交换,执行下一轮迭代。 lResult.Add(bestPoint); listinPoints.Remove(bestPoint); if (listinPoints.Count > 0) { outdir = (bestPoint - startPoint).normalized; startPoint = bestPoint; indir = far - startPoint; lHave = listinPoints; listinPoints = new List<Double2>(); isHaveBestPoint = false; } else break; } else break; } return lResult; } /// <summary> /// 计算超出线段范围 /// </summary> /// <param name="lineStart"></param> /// <param name="lineEnd"></param> /// <param name="listMidPoint"></param> /// <param name="nearestIndex"></param> /// <param name="farestIndex"></param> private static void CalcNearFarest(Double2 lineStart, Double2 lineEnd, List<Double2> listMidPoint, ref int nearestIndex, ref int farestIndex) { if (listMidPoint == null || listMidPoint.Count == 0) return; nearestIndex = -1; farestIndex = -1; double outStartdis = 0; double outEnddis = 0; LineSegment2D line = new LineSegment2D(lineStart, lineEnd); for (int i = 0; i < listMidPoint.Count; i++) { ProjectPointInLine pp=line.CheckProjectInLine(listMidPoint[i]); if (pp == ProjectPointInLine.In) continue; Double2 projectPoint = line.ProjectPoint(listMidPoint[i]); if (pp == ProjectPointInLine.OutStart) { double dis = (projectPoint - lineStart).sqrMagnitude; if (dis > outStartdis) { outStartdis = dis; nearestIndex = i; } } else if (pp == ProjectPointInLine.OutStart) { double dis = (projectPoint - line
65,423
thestackv1_concat_by_repo-long/65536-65536
ID": "O*L*E-----H****", "D": "Drug Lab", "DC": "8", "H": "5.X.2.6", }, { "ID": "O*L*H-----H****", "D": "House/Residence", "DC": "8", "H": "5.X.2.7", }, { "ID": "O*L*N-----H****", "D": "Cave Entrance", "DC": "8", "H": "5.X.2.8", }, { "ID": "O*L*H-----H****", "D": "Palace/Presidential Residence", "DC": "8", "H": "5.X.2.9", }, { "ID": "O*L*F-----H****", "D": "Polling Place", "DC": "8", "H": "5.X.2.10", }, { "ID": "O*O*------*****", "D": "Operations", "DC": "0", "H": "5.X.3", }, { "ID": "O*O*P-----*****", "D": "Patrolling", "DC": "8", "H": "5.X.3.1", }, { "ID": "O*O*R-----*****", "D": "Recruitment", "DC": "0", "H": "5.X.3.2", }, { "ID": "O*O*RW----*****", "D": "Recruitment (Willing)", "DC": "8", "H": "5.X.3.2.1", }, { "ID": "O*O*RC----*****", "D": "Recruitment (Coerced/Impressed)", "DC": "8", "H": "5.X.3.2.2", }, { "ID": "O*O*D-----*****", "D": "Demonstration", "DC": "8", "H": "5.X.3.3", }, { "ID": "O*O*M-----*****", "D": "Mine Laying", "DC": "8", "H": "5.X.3.4", }, { "ID": "O*O*Y-----*****", "D": "Psychological Operations (Psyop)", "DC": "8", "H": "5.X.3.5", }, { "ID": "O*O*YT----*****", "D": "Psyop (TV and Radio Propaganda)", "DC": "8", "H": "5.X.3.5.1", }, { "ID": "O*O*YW----*****", "D": "Psyop (Written Propaganda)", "DC": "8", "H": "5.X.3.5.2", }, { "ID": "O*O*YH----*****", "D": "House-to-House Propaganda", "DC": "8", "H": "5.X.3.5.3", }, { "ID": "O*O*F-----*****", "D": "Foraging/Searching", "DC": "8", "H": "5.X.3.6", }, { "ID": "O*O*S-----*****", "D": "Spy", "DC": "8", "H": "5.X.3.7", }, { "ID": "O*O*O-----*****", "D": "Food Distribution", "DC": "8", "H": "5.X.3.8", }, { "ID": "O*O*E-----*****", "D": "Extortion", "DC": "8", "H": "5.X.3.9", }, { "ID": "O*O*H-----*****", "D": "Hijacking", "DC": "0", "H": "5.X.3.10", }, { "ID": "O*O*HT----*****", "D": "Hijacking (Vehicle)", "DC": "8", "H": "5.X.3.10.1", }, { "ID": "O*O*HA----*****", "D": "Hijacking (Airplane)", "DC": "8", "H": "5.X.3.10.2", }, { "ID": "O*O*HV----*****", "D": "Hijacking (Boat)", "DC": "8", "H": "5.X.3.10.3", }, { "ID": "O*O*K-----*****", "D": "Kidnapping", "DC": "8", "H": "5.X.3.11", }, { "ID": "O*O*KA----*****", "D": "Attempted Kidnapping", "DC": "8", "H": "5.X.3.11.1", }, { "ID": "O*O*A-----*****", "D": "Arrest", "DC": "8", "H": "5.X.3.12", }, { "ID": "O*O*U-----*****", "D": "Drug Operation", "DC": "8", "H": "5.X.3.13", }, { "ID": "O*O*UT----*****", "D": "Drug Trafficking", "DC": "8", "H": "5.X.3.13.1", }, { "ID": "O*O*C-----*****", "D": "Composite Loss", "DC": "8", "H": "5.X.3.14", }, { "ID": "O*O*CA----*****", "D": "Composite Loss Combat", "DC": "8", "H": "5.X.3.14.1", }, { "ID": "O*O*CB----*****", "D": "Composite Loss Accident", "DC": "8", "H": "5.X.3.14.2", }, { "ID": "O*O*CC----*****", "D": "Composite Loss Other", "DC": "8", "H": "5.X.3.14.3", }, { "ID": "O*O*N-----*****", "D": "Raid on a House", "DC": "8", "H": "5.X.3.15", }, { "ID": "O*O*2-----*****", "D": "Burglary", "DC": "8", "H": "5.X.3.16", }, { "ID": "O*O*V-----*****", "D": "Home Eviction", "DC": "8", "H": "5.X.3.17", }, { "ID": "O*O*I-----*****", "D": "Black Marketing", "DC": "8", "H": "5.X.3.18", }, { "ID": "O*O*J-----*****", "D": "Jail Break", "DC": "8", "H": "5.X.3.19", }, { "ID": "O*O*B-----*****", "D": "Robbery", "DC": "8", "H": "5.X.3.20", }, { "ID": "O*O*G-----*****", "D": "Sabotage", "DC": "8", "H": "5.X.3.21", }, { "ID": "O*O*X-----*****", "D": "Smuggling", "DC": "8", "H": "5.X.3.22", }, { "ID": "O*O*W-----*****", "D": "Rock Throwing", "DC": "8", "H": "5.X.3.23", }, { "ID": "O*O*Z-----*****", "D": "Suspicious Activity", "DC": "8", "H": "5.X.3.24", }, { "ID": "O*O*T-----*****", "D": "Theft", "DC": "8", "H": "5.X.3.25", }, { "ID": "O*O*TV----*****", "D": "Wheeled Vehicle Theft", "DC": "8", "H": "5.X.3.25.1", }, { "ID": "O*O*Q-----*****", "D": "Warrant Served", "DC": "8", "H": "5.X.3.26", }, { "ID": "O*I*------*****", "D": "Items", "DC": "0", "H": "5.X.4", }, { "ID": "O*I*R-----*****", "D": "Refugees", "DC": "8", "H": "5.X.4.1", }, { "ID": "O*I*S-----*****", "D": "Safe House", "DC": "8", "H": "5.X.4.2", }, { "ID": "O*I*G-----*****", "D": "Graffiti", "DC": "8", "H": "5.X.4.3", }, { "ID": "O*I*V-----*****", "D": "Vandalism/Loot/Ransack/Plunder/Sack", "DC": "8", "H": "5.X.4.4", }, { "ID": "O*I*I-----*****", "D": "Known Insurgent Vehicle", "DC": "8", "H": "5.X.4.5", }, { "ID": "O*I*D-----*****", "D": "Drug Vehicle", "DC": "8", "H": "5.X.4.6", }, { "ID": "O*I*F-----*****", "D": "Internal Security Force", "DC": "8", "H": "5.X.4.7", }, { "ID": "O*I*M-----*****", "D": "Meeting", "DC": "8", "H": "5.X.4.8", }, { "ID": "O*I*T-----*****", "D": "Tent", "DC": "8", "H": "5.X.4.9", }, { "ID": "O*P*------*****", "D": "Individual", "DC": "8", "H": "5.X.5", }, { "ID": "O*P*A-----*****", "D": "Leader", "DC": "8", "H": "5.X.5.1", }, { "ID": "O*P*AR----*****", "D": "Religious Leader", "DC": "8", "H": "5.X.5.1.1", }, { "ID": "O*P*B-----*****", "D": "Targeted Individual", "DC": "8", "H": "5.X.5.2", }, { "ID": "O*P*C-----*****", "D": "Terrorist", "DC": "8", "H": "5.X.5.3", }, { "ID": "O*P*D-----*****", "D": "Dead Body", "DC": "8", "H": "5.X.5.4", }, { "ID": "O*P*E-----*****", "D": "Speaker", "DC": "8", "H": "5.X.5.5", }, { "ID": "O*P*F-----*****", "D": "IED Suicide Bomber", "DC": "8", "H": "5.X.5.6", }, { "ID": "O*P*G-----*****", "D": "Exfiltrating Individual", "DC": "8", "H": "5.X.5.7", }, { "ID": "O*P*H-----*****", "D": "Infiltrating Individual", "DC": "8", "H": "5.X.5.8", }, { "ID": "O*G*------*****", "D": "Non-Military Group or Organization", "DC": "8", "H": "5.X.6", }, { "ID": "O*G*B-----*****", "D": "Non-Governmental Organizations (NGO)", "DC": "8", "H": "5.X.6.2", }, { "ID": "O*G*C-----*****", "D": "Terrorist Organization", "DC": "8", "H": "5.X.6.3", }, { "ID": "O*G*D-----*****", "D": "Religious Organization", "DC": "8", "H": "5.X.6.4", }, { "ID": "O*G*E-----*****", "D": "Foreign Fighter", "DC": "8", "H": "5.X.6.5", }, { "ID": "O*G*F-----*****", "D": "Gang", "DC": "8", "H": "5.X.6.6", }, { "ID": "O*R*------*****", "D": "Rape", "DC": "8", "H": "5.X.7", }, { "ID": "O*R*A-----*****", "D": "Attempted Rape", "DC": "8", "H": "5.X.7.1", }, { "ID": "O*E*------*****", "D": "Events SASO", "DC": "0", "H": "5.X.10", }, { "ID": "O*E*A-----*****", "D": "Elections SASO", "DC": "8", "H": "5.X.10.1", }, { "ID": "O*E*B-----*****", "D": "Speech SASO", "DC": "8", "H": "5.X.10.2", }, { "ID": "O*E*C-----*****", "D": "Sermon SASO", "DC": "8", "H": "5.X.10.3", }, { "ID": "O*E*D-----*****", "D": "Meeting SASO", "DC": "8", "H": "5.X.10.4", }, { "ID": "O*E*E-----*****", "D": "Demonstration(Events) SASO", "DC": "8", "H": "5.X.10.5", }, { "ID": "O*E*F-----*****", "D": "Riot SASO", "DC": "8", "H": "5.X.10.6", }, { "ID": "O*E*G-----*****", "D": "Gang Activity SASO", "DC": "8", "H": "5.X.10.7", }, { "ID": "O*E*H-----*****", "D": "Jail Break/Escape Custody SASO", "DC": "8", "H": "5.X.10.8", }, { "ID": "O*E*I-----*****", "D": "Rock Throwing SASO", "DC": "8", "H": "5.X.10.9", }, { "ID": "O*E*J-----*****", "D": "Illegal Selling/Purchasing/Distributing/Black Market SASO", "DC": "8", "H": "5.X.10.10", }, { "ID": "O*E*K-----*****", "D": "Surveillance SASO", "DC": "8", "H": "5.X.10.11", }, { "ID": "O*E*L-----*****", "D": "Lights SASO", "DC": "8", "H": "5.X.10.12", }, { "ID": "O*E*M-----*****", "D": "Border Crossing SASO", "DC": "8", "H": "5.X.10.13", }, { "ID": "O*E*N-----*****", "D": "Border Activity SASO", "DC": "8", "H": "5.X.10.14", }, { "ID": "O*E*O-----*****", "D": "Smuggling SASO", "DC": "8", "H": "5.X.10.15", }, { "ID": "O*E*P-----*****", "D": "Exfiltration SASO", "DC": "8", "H": "5.X.10.16", }, { "ID": "O*E*Q-----*****", "D": "Infiltration SASO", "DC": "8", "H": "5.X.10.17", }, { "ID": "O*E*R-----*****", "D": "Auto Theft SASO", "DC": "8", "H": "5.X.10.18", }, { "ID": "O*E*S-----*****", "D": "Auto Accident SASO", "DC": "8", "H": "5.X.10.19", }, { "ID": "O*E*T-----*****", "D": "Looting SASO", "DC": "8", "H": "5.X.10.20", }, { "ID": "O*E*U-----*****", "D": "Theft SASO", "DC": "8", "H": "5.X.10.21", }, { "ID": "O*E*V-----*****", "D": "<NAME>", "DC": "8", "H": "5.X.10.22", }, { "ID": "O*E*W-----*****", "D": "Home Eviction SASO", "DC": "8", "H": "5.X.10.23", }, { "ID": "O*E*X-----*****", "D": "Shooting (Non Deadly) SASO", "DC": "8", "H": "5.X.10.24", }, { "ID": "O*E*Y-----*****", "D": "Raid SASO", "DC": "8", "H": "5.X.10.25", }, { "ID": "O*E*Z-----*****", "D": "Sabotage SASO", "DC": "8", "H": "5.X.10.26", }, { "ID": "O*E*AA----*****", "D": "Warrant Served SASO", "DC": "8", "H": "5.X.10.27", }, { "ID": "O*E*AB----*****", "D": "Rape SASO", "DC": "8", "H": "5.X.10.28", }, { "ID": "O*E*AC----*****", "D": "Attempted Rape SASO", "DC": "8", "H": "5.X.10.29", }, { "ID": "O*E*AD----*****", "D": "Attack(Events) SASO", "DC": "0", "H": "5.X.10.30", }, { "ID": "O*E*ADA---*****", "D": "Attack on NGO SASO", "DC": "8", "H": "5.X.10.30.1", }, { "ID": "O*E*ADB---*****", "D": "Terrorist Attack SASO", "DC": "8", "H": "5.X.10.30.2", }, { "ID": "O*E*ADC---*****", "D": "Grenade Attack SASO", "DC": "8", "H": "5.X.10.30.3", }, { "ID": "O*E*ADD---*****", "D": "Rocket Attack SASO", "DC": "8", "H": "5.X.10.30.4", }, { "ID": "O*E*AE----*****", "D": "Explosions SASO", "DC": "0", "H": "5.X.10.31", }, { "ID": "O*E*AEA---*****", "D": "Explosion (general) SASO", "DC": "8", "H": "5.X.10.31.1", }, { "ID": "O*E*AEB---*****", "D": "Explosion, Mine SASO", "DC": "8", "H": "5.X.10.31.2", }, { "ID": "O*E*AEC---*****", "D": "Explosion, Grenade SASO", "DC": "8", "H": "5.X.10.31.3", }, { "ID": "O*E*AED---*****", "D": "Explosion, Bomb SASO", "DC": "8", "H": "5.X.10.31.4", }, { "ID": "O*E*AEE---*****", "D": "Explosion, Mortar Fire SASO", "DC": "8", "H": "5.X.10.31.5", }, { "ID": "O*E*AEF---*****", "D": "Explosion, Incendiary SASO", "DC": "8", "H": "5.X.10.31.6", }, { "ID": "O*E*AEG---*****", "D": "Explosion, Rocket SASO", "DC": "8", "H": "5.X.10.31.7", }, { "ID": "O*E*AEH---*****", "D": "Explosion, Improvised Explosive Device (IED) SASO", "DC": "8", "H": "5.X.10.31.8", }, { "ID": "O*E*AEI---*****", "D": "Explosion, Car Bomb SASO", "DC": "8", "H": "5.X.10.31.9", }, { "ID": "O*E*AEJ---*****", "D": "Suicide Bombing SASO", "DC": "8", "H": "5.X.10.31.10", }, { "ID": "O*E*AF----*****", "D": "Fighting/Contact SASO", "DC": "0", "H": "5.X.10.32", }, { "ID": "O*E*AFA---*****", "D": "Fighting (General) SASO", "DC": "8", "H": "5.X.10.32.1", }, { "ID": "O*E*AFB---*****", "D": "Coalition vs. Enemy SASO", "DC": "8", "H": "5.X.10.32.2", }, { "ID": "O*E*AFC---*****", "D": "Coalition vs. Coalition SASO", "DC": "8", "H": "5.X.10.32.3", }, { "ID": "O*E*AG----*****", "D": "Drug Possession SASO", "DC": "8", "H": "5.X.10.33", }, { "ID": "O*E*AH----*****", "D": "Drug Trafficking SASO", "DC": "8", "H": "5.X.10.34", }, { "ID": "O*E*AI----*****", "D": "Suspicious Activity SASO", "DC": "8", "H": "5.X.10.35", }, { "ID": "O*E*AJ----*****", "D": "Activity SASO", "DC": "8", "H": "5.X.10.36", }, { "ID": "O*E*AK----*****", "D": "Threat SASO", "DC": "8", "H": "5.X.10.37", }, { "ID": "O*E*AL----*****", "D": "Crater SASO", "DC": "8", "H": "5.X.10.38", }, { "ID": "O*E*AM----*****", "D": "Pothole SASO", "DC": "8", "H": "5.X.10.39", }, { "ID": "O*E*AN----*****", "D": "Escalation of Force SASO", "DC": "8", "H": "5.X.10.40", }, { "ID": "O*E*AO----*****", "D": "Submunitions SASO", "DC": "8", "H": "5.X.10.41", }, { "ID": "O*E*AP----*****", "D": "Confiscation SASO", "DC": "8", "H": "5.X.10.42", }, { "ID": "O*E*AQ----*****", "D": "Counter Insurgency SASO", "DC": "8", "H": "5.X.10.43", }, { "ID": "O*E*AR----*****", "D": "Counter Terrorism SASO", "DC": "8", "H": "5.X.10.44", }, { "ID": "O*E*AS----*****", "D": "Humanitarian Assistance SASO", "DC": "8", "H": "5.X.10.45", }, { "ID": "O*E*AT----*****", "D": "Tests of Security SASO", "DC": "8", "H": "5.X.10.46", }, { "ID": "O*E*AU----*****", "D": "AWOL SASO", "DC": "8", "H": "5.X.10.47", }, { "ID": "O*E*AV----*****", "D": "Curfew SASO", "DC": "8", "H": "5.X.10.48", }, { "ID": "O*E*AW----*****", "D": "DUI SASO", "DC": "8", "H": "5.X.10.49", }, { "ID": "O*E*AX----*****", "D": "Prostitution SASO", "DC": "8", "H": "5.X.10.50", }, { "ID": "O*Y*------*****", "D": "Organization/Groups SASO", "DC": "0", "H": "5.X.11", }, { "ID": "O*Y*A-----*****", "D": "Organization (General) SASO", "DC": "8", "H": "5.X.11.1", }, { "ID": "O*Y*B-----*****", "D": "NGO Organization SASO", "DC": "8", "H": "5.X.11.2", }, { "ID": "O*Y*C-----*****", "D": "Displaced Persons, Refugees SASO", "DC": "8", "H": "5.X.11.3", }, { "ID": "O*Y*D-----*****", "D": "Terrorist Organization SASO", "DC": "8", "H": "5.X.11.4", }, { "ID": "O*Y*E-----*****", "D": "Religious Organization SASO", "DC": "8", "H": "5.X.11.5", }, { "ID": "O*Y*F-----*****", "D": "Group Tribe Cell SASO", "DC": "8", "H": "5.X.11.6", }, { "ID": "O*Y*G-----*****", "D": "Foreign Fighters SASO", "DC": "8", "H": "5.X.11.7", }, { "ID": "O*Y*R-----*****", "D": "Red Cross SASO", "DC": "8", "H": "5.X.11.8", }, { "ID": "O*Y*SP----*****", "D": "State Police SASO", "DC": "8", "H": "5.X.11.9", }, { "ID": "O*Y*LP----*****", "D": "Local Police SASO", "DC": "8", "H": "5.X.11.10", }, { "ID": "O*Y*SH----*****", "D": "Shelter SASO", "DC": "8", "H": "5.X.11.11", }, { "ID": "O*Y*FM----*****", "D": "FEMA SASO", "DC": "8", "H": "5.X.11.12", }, { "ID": "O*Y*SA----*****", "D": "Staging Area SASO", "DC": "8", "H": "5.X.11.13", }, { "ID": "O*Y*EP----*****", "D": "Evacuation Point SASO", "DC": "8", "H": "5.X.11.14", }, { "ID": "O*Y*PD----*****", "D": "Person in Distress SASO", "DC": "8", "H": "5.X.11.15", }, { "ID": "O*S*------*****", "D": "Structures SASO", "DC": "0", "H": "5.X.13", }, { "ID": "O*S*A-----*****", "D": "Compound/Post/Fort SASO", "DC": "8", "H": "5.X.13.1", }, { "ID": "O*S*B-----*****", "D": "House/Residence SASO", "DC": "8", "H": "5.X.13.2", }, { "ID": "O*S*C-----*****", "D": "Safe House(Structures) SASO", "DC": "8", "H": "5.X.13.3", }, { "ID": "O*S*D-----*****", "D": "Church SASO", "DC": "8", "H": "5.X.13.4", }, { "ID": "O*S*E-----*****", "D": "Mosque SASO", "DC": "8", "H": "5.X.13.5", }, { "ID": "O*S*F-----*****", "D": "Synagogue SASO", "DC": "8", "H": "5.X.13.6", }, { "ID": "O*S*G-----*****", "D": "Warehouse/Storage Facility SASO", "DC": "8", "H": "5.X.13.7", }, { "ID": "O*S*H-----*****", "D": "Bunker/Underground Facility SASO", "DC": "8", "H": "5.X.13.8", }, { "ID": "O*S*I-----*****", "D": "Tents SASO", "DC": "8", "H": "5.X.13.9", }, { "ID": "O*S*J-----*****", "D": "<NAME>", "DC": "8", "H": "5.X.13.10", }, { "ID": "O*S*K-----*****", "D": "Camps SASO", "DC": "0", "H": "5.X.13.11", }, { "ID": "O*S*KA----*****", "D": "Camp (General) SASO", "DC": "8", "H": "5.X.13.11.1", }, { "ID": "O*S*KB----*****", "D": "Displaced Persons/Refugees Camp SASO", "DC": "8", "H": "5.X.13.11.2", }, { "ID": "O*S*KC----*****", "D": "Training Camp SASO", "DC": "8", "H": "5.X.13.11.3", }, { "ID": "O*S*L-----*****", "D": "Prison/Detention Facility SASO", "DC": "8", "H": "5.X.13.12", }, { "ID": "O*S*M-----*****", "D": "Police Station SASO", "DC": "8", "H": "5.X.13.13", }, { "ID": "O*S*N-----*****", "D": "Palace/Presidential Residence SASO", "DC": "8", "H": "5.X.13.14", }, { "ID": "O*Q*------*****", "D": "Equipment/Weapons SASO", "DC": "0", "H": "5.X.14", }, { "ID": "O*Q*A-----*****", "D": "Weapons Found SASO", "DC": "8", "H": "5.X.14.1", }, { "ID": "O*Q*B-----*****", "D": "Weapons Cache SASO", "DC": "8", "H": "5.X.14.2", }, { "ID": "O*Q*C-----*****", "D": "Weapons Confiscated SASO", "DC": "8", "H": "5.X.14.3", }, { "ID": "O*Q*D-----*****", "D": "Weapons Sale SASO", "DC": "8", "H": "5.X.14.4", }, { "ID": "O*Q*E-----*****", "D": "Weapons Market SASO", "DC": "8", "H": "5.X.14.5", }, { "ID": "O*Q*F-----*****", "D": "Chem/Bio Weapons Cache SASO", "DC": "8", "H": "5.X.14.6", }, { "ID": "O*Q*G-----*****", "D": "Improvised Explosive Device (IED) SASO", "DC": "8", "H": "5.X.14.7", }, { "ID": "O*Q*H-----*****", "D": "Unexploded Ordnance (UXO) SASO", "DC": "8", "H": "5.X.14.8", }, { "ID": "O*Q*I-----*****", "D": "Horses SASO", "DC": "8", "H": "5.X.14.9", }, { "ID": "O*Q*J-----*****", "D": "Camels SASO", "DC": "8", "H": "5.X.14.10", }, { "ID": "O*Q*K-----*****", "D": "Donkeys SASO", "DC": "8", "H": "5.X.14.11", }, { "ID": "E*-*------*****", "D": "Emergency Management Symbols", "DC": "0", "H": "6.X", }, { "ID": "E*I*------*****", "D": "Incident", "DC": "0", "H": "6.X.1", }, { "ID": "E*I*A-----*****", "D": "Civil Disturbance Incident", "DC": "8", "H": "6.X.1.1", }, { "ID": "O*O*D-----*****", "D": "Civil Demonstration", "DC": "8", "H": "6.X.1.1.1", }, { "ID": "O*I*R-----*****", "D": "Civil Displaced Population", "DC": "0", "H": "6.X.1.1.2", }, { "ID": "E*I*AC----*****", "D": "Civil Rioting", "DC": "8", "H": "6.X.1.1.3", }, { "ID": "E*I*B-----*****", "D": "Criminal Activity Incident", "DC": "8", "H": "6.X.1.2", }, { "ID": "E*I*BA----*****", "D": "Bomb Threat", "DC": "8", "H": "6.X.1.2.1", }, { "ID": "O*V*B-----*****", "D": "Bomb", "DC": "8", "H": "6.X.1.2.2", }, { "ID": "E*I*BC----*****", "D": "Explosion (Bomb)", "DC": "8", "H": "6.X.1.2.3", }, { "ID": "E*I*BD----*****", "D": "Looting", "DC": "8", "H": "6.X.1.2.4", }, { "ID": "O*V*P-----*****", "D": "Poisoning", "DC": "8", "H": "6.X.1.2.5", }, { "ID": "E*I*BF----*****", "D": "Shooting", "DC": "8", "H": "6.X.1.2.6", }, { "ID": "E*I*C-----*****", "D": "Fire Incident", "DC": "8", "H": "6.X.1.3", }, { "ID": "E*I*CA----*****", "D": "Hot Spot", "DC": "8", "H": "6.X.1.3.1", }, { "ID": "E*I*CB----*****", "D": "Non-Residential Fire", "DC": "8", "H": "6.X.1.3.2", }, { "ID": "E*I*CC----*****", "D": "Origin", "DC": "8", "H": "6.X.1.3.3", }, { "ID": "E*I*CD----*****", "D": "Residential Fire", "DC": "8", "H": "6.X.1.3.4", }, { "ID": "E*I*CE----*****", "D": "School Fire", "DC": "8", "H": "6.X.1.3.5", }, { "ID": "E*I*CF----*****", "D": "Smoke", "DC": "8", "H": "6.X.1.3.6", }, { "ID": "E*I*CG----*****", "D": "Special Needs Fire", "DC": "8", "H": "6.X.1.3.7", }, { "ID": "E*I*CH----*****", "D": "Wild Fire", "DC": "8", "H": "6.X.1.3.8", }, { "ID": "E*I*D-----*****", "D": "Hazardous Material Incident", "DC": "8", "H": "6.X.1.4", }, { "ID": "E*I*DA----*****", "D": "Chemical Agent", "DC": "8", "H": "6.X.1.4.1", }, { "ID": "E*I*DB----*****", "D": "Corrosive Material", "DC": "8", "H": "6.X.1.4.2", }, { "ID": "E*I*DC----*****", "D": "Hazardous When Wet", "DC": "8", "H": "6.X.1.4.3", }, { "ID": "E*I*DD----*****", "D": "Explosive", "DC": "8", "H": "6.X.1.4.4", }, { "ID": "E*I*DE----*****", "D": "Flammable Gas", "DC": "8", "H": "6.X.1.4.5", }, { "ID": "E*I*DF----*****", "D": "Flammable Liquid", "DC": "8", "H": "6.X.1.4.6", }, { "ID": "E*I*DG----*****", "D": "Flammable Solid", "DC": "8", "H": "6.X.1.4.7", }, { "ID": "E*I*DH----*****", "D": "Non-Flammable Gas", "DC": "8", "H": "6.X.1.4.8", }, { "ID": "E*I*DI----*****", "D": "Organic Peroxide", "DC": "8", "H": "6.X.1.4.9", }, { "ID": "E*I*DJ----*****", "D": "Oxidizer", "DC": "8", "H": "6.X.1.4.10", }, { "ID": "E*I*DK----*****", "D": "Radioactive Material", "DC": "8", "H": "6.X.1.4.11", }, { "ID": "E*I*DL----*****", "D": "Spontaneously Combustible", "DC": "8", "H": "6.X.1.4.12", }, { "ID": "E*I*DM----*****", "D": "Toxic Gas", "DC": "8", "H": "6.X.1.4.13", }, { "ID": "E*I*DN----*****", "D": "Toxic and Infectious", "DC": "8", "H": "6.X.1.4.14", }, { "ID": "E*I*DO----*****", "D": "Unexploded Ordinance", "DC": "8", "H": "6.X.1.4.15", }, { "ID": "E*I*E-----*****", "D": "Air Incident", "DC": "8", "H": "6.X.1.5", }, { "ID": "E*I*EA----*****", "D": "Air Accident", "DC": "8", "H": "6.X.1.5.1", }, { "ID": "O*O*HA----*****", "D": "Air Hijacking", "DC": "8", "H": "6.X.1.5.2", }, { "ID": "E*I*F-----*****", "D": "Marine Incident", "DC": "8", "H": "6.X.1.6", }, { "ID": "E*I*FA----*****", "D": "Marine Accident", "DC": "8", "H": "6.X.1.6.1", }, { "ID": "O*O*HV----*****", "D": "Marine Hijacking", "DC": "8", "H": "6.X.1.6.2", }, { "ID": "E*I*G-----*****", "D": "Rail Incident", "DC": "8", "H": "6.X.1.7", }, { "ID": "E*I*GA----*****", "D": "Rail Accident", "DC": "8", "H": "6.X.1.7.1", }, { "ID": "E*I*GB----*****", "D": "Rail Hijacking", "DC": "8", "H": "6.X.1.7.2", }, { "ID": "E*I*H-----*****", "D": "Vehicle Incident", "DC": "8", "H": "6.X.1.8", }, { "ID": "E*I*HA----*****", "D": "Vehicle Accident", "DC": "8", "H": "6.X.1.8.1", }, { "ID": "O*O*HT----*****", "D": "Vehicle Hijacking", "DC": "8", "H": "6.X.1.8.2", }, { "ID": "E*N*------*****", "D": "Natural Events", "DC": "0", "H": "6.X.2", }, { "ID": "E*O*------*****", "D": "Operations", "DC": "0", "H": "6.X.3", }, { "ID": "E*O*A-----*****", "D": "Emergency Medical Operation", "DC": "8", "H": "6.X.3.1", }, { "ID": "E*O*AA----*****", "D": "Emergency Medical Operation Unit", "DC": "8", "H": "6.X.3.1.1", }, { "ID": "E*O*AB----*****", "D": "Emergency Medical Operation Equipment", "DC": "8", "H": "6.X.3.1.2", }, { "ID": "E*O*AC----H****", "D": "Emergency Medical Operation Installation", "DC": "8", "H": "6.X.3.1.3", }, { "ID": "E*O*AD----H****", "D": "EMT Station Location", "DC": "8", "H": "6.X.3.1.4", }, { "ID": "E*O*AE----*****", "D": "Ambulance", "DC": "8", "H": "6.X.3.1.5", }, { "ID": "E*O*AF----*****", "D": "Medical Evacuation Helicopter", "DC": "8", "H": "6.X.3.1.6", }, { "ID": "E*O*AG----H****", "D": "Health Department Facility", "DC": "8", "H": "6.X.3.1.7", }, { "ID": "S*G*IXH---H****", "D": "Hospital", "DC": "8", "H": "6.X.3.1.8", }, { "ID": "S*S*NM----*****", "D": "Hospital Ship", "DC": "8", "H": "6.X.3.1.9", }, { "ID": "E*O*AJ----H****", "D": "Medical Facilities Out Patient", "DC": "8", "H": "6.X.3.1.10", }, { "ID": "E*O*AK----H****", "D": "Morgue", "DC": "8", "H": "6.X.3.1.11", }, { "ID": "E*O*AL----H****", "D": "Pharmacy", "DC": "8", "H": "6.X.3.1.12", }, { "ID": "E*O*AM----H****", "D": "Triage", "DC": "8", "H": "6.X.3.1.13", }, { "ID": "E*O*B-----*****", "D": "Emergency Operation", "DC": "8", "H": "6.X.3.2", }, { "ID": "E*O*BA----*****", "D": "Emergency Operation Unit", "DC": "8", "H": "6.X.3.2.1", }, { "ID": "E*O*BB----*****", "D": "Emergency Operation Equipment", "DC": "8", "H": "6.X.3.2.2", }, { "ID": "E*O*BC----H****", "D": "Emergency Operation Installation", "DC": "8", "H": "6.X.3.2.3", }, { "ID": "E*O*BD----*****", "D": "Emergency Collection Evacuation Point", "DC": "8", "H": "6.X.3.2.4", }, { "ID": "E*O*BE----H****", "D": "Emergency Incident Command Center", "DC": "8", "H": "6.X.3.2.5", }, { "ID": "E*O*BF----H****", "D": "Emergency Operations Center", "DC": "8", "H": "6.X.3.2.6", }, { "ID": "E*O*BG----H****", "D": "Emergency Public Information Center", "DC": "8", "H": "6.X.3.2.7", }, { "ID": "E*O*BH----H****", "D": "Emergency Shelter", "DC": "8", "H": "6.X.3.2.8", }, { "ID": "E*O*BI----H****", "D": "Emergency Staging Area", "DC": "8", "H": "6.X.3.2.9", }, { "ID": "E*O*BJ----*****", "D": "Emergency Team", "DC": "8", "H": "6.X.3.2.10", }, { "ID": "E*O*BK----H****", "D": "Emergency Water Distribution Center", "DC": "8", "H": "6.X.3.2.11", }, { "ID": "E*O*BL----H****", "D": "Emergency Food Distribution Center", "DC": "8", "H": "6.X.3.2.12", }, { "ID": "E*O*C-----*****", "D": "Fire Fighting Operation", "DC": "8", "H": "6.X.3.3", }, { "ID": "E*O*CA----*****", "D": "Fire Fighting Operation Unit", "DC": "8", "H": "6.X.3.3.1", }, { "ID": "E*O*CB----*****", "D": "Fire Fighting Operation Equipment", "DC": "8", "H": "6.X.3.3.2", }, { "ID": "E*O*CC----*****", "D": "Fire Hydrant", "DC": "8", "H": "6.X.3.3.3", }, { "ID": "E*O*CD----H****", "D": "Other Water Supply Location", "DC": "8", "H": "6.X.3.3.4", }, { "ID": "E*O*CE----H****", "D": "Fire Station", "DC": "8", "H": "6.X.3.3.5", }, { "ID": "E*O*D-----*****", "D": "Law Enforcement Operation", "DC": "8", "H": "6.X.3.4", }, { "ID": "E*O*DA----*****", "D": "Law Enforcement Operation Unit", "DC": "8", "H": "6.X.3.4.1", }, { "ID": "E*O*DB----*****", "D": "Law Enforcement Operation Equipment", "DC": "8", "H": "6.X.3.4.2", }, { "ID": "E*O*DC----H****", "D": "Law Enforcement Operation Installation", "DC": "8", "H": "6.X.3.4.3", }, { "ID": "E*O*DD----*****", "D": "ATF", "DC": "8", "H": "6.X.3.4.4", }, { "ID": "E*O*DDA---*****", "D": "ATF Unit", "DC": "8", "H": "6.X.3.4.4.1", }, { "ID": "E*O*DDB---*****", "D": "ATF Equipment", "DC": "8", "H": "6.X.3.4.4.2", }, { "ID": "E*O*DDC---H****", "D": "ATF Installation", "DC": "8", "H": "6.X.3.4.4.3", }, { "ID": "E*O*DE----*****", "D": "Border Patrol", "DC": "8", "H": "6.X.3.4.5", }, { "ID": "E*O*DEA---*****", "D": "Border Patrol Unit", "DC": "8", "H": "6.X.3.4.5.1", }, { "ID": "E*O*DEB---*****", "D": "Border Patrol Equipment", "DC": "8", "H": "6.X.3.4.5.2", }, { "ID": "E*O*DEC---H****", "D": "Border Patrol Installation", "DC": "8", "H": "6.X.3.4.5.3", }, { "ID": "E*O*DF----*****", "D": "Customs Service", "DC": "8", "H": "6.X.3.4.6", }, { "ID": "E*O*DFA---*****", "D": "Customs Service Unit", "DC": "8", "H": "6.X.3.4.6.1", }, { "ID": "E*O*DFB---*****", "D": "Customs Service Equipment", "DC": "8", "H": "6.X.3.4.6.2", }, { "ID": "E*O*DFC---H****", "D": "Customs Service Installation", "DC": "8", "H": "6.X.3.4.6.3", }, { "ID": "E*O*DG----*****", "D": "DEA", "DC": "8", "H": "6.X.3.4.7", }, { "ID": "E*O*DGA---*****", "D": "DEA Unit", "DC": "8", "H": "6.X.3.4.7.1", }, { "ID": "E*O*DGB---*****", "D": "DEA Equipment", "DC": "8", "H": "6.X.3.4.7.2", }, { "ID": "E*O*DGC---H****", "D": "DEA Installation", "DC": "8", "H": "6.X.3.4.7.3", }, { "ID": "E*O*DH----*****", "D": "DOJ", "DC": "8", "H": "6.X.3.4.8", }, { "ID": "E*O*DHA---*****", "D": "DOJ Unit", "DC": "8", "H": "6.X.3.4.8.1", }, { "ID": "E*O*DHB---*****", "D": "DOJ Equipment", "DC": "8", "H": "6.X.3.4.8.2", }, { "ID": "E*O*DHC---H****", "D": "DOJ Installation", "DC": "8", "H": "6.X.3.4.8.3", }, { "ID": "E*O*DI----*****", "D": "FBI", "DC": "8", "H": "6.X.3.4.9", }, { "ID": "E*O*DIA---*****", "D": "FBI Unit", "DC": "8", "H": "6.X.3.4.9.1", }, { "ID": "E*O*DIB---*****", "D": "FBI Equipment", "DC": "8", "H": "6.X.3.4.9.2", }, { "ID": "E*O*DIC---H****", "D": "FBI Installation", "DC": "8", "H": "6.X.3.4.9.3", }, { "ID": "E*O*DJ----*****", "D": "Police", "DC": "8", "H": "6.X.3.4.10", }, { "ID": "S*G*UULC--*****", "D": "Police Unit", "DC": "8", "H": "6.X.3.4.10.1", }, { "ID": "E*O*DJB---*****", "D": "Police Equipment", "DC": "8", "H": "6.X.3.4.10.2", }, { "ID": "E*O*DJC---H****", "D": "Police Installation", "DC": "8", "H": "6.X.3.4.10.3", }, { "ID": "E*O*DK----H****", "D": "Prison", "DC": "8", "H": "6.X.3.4.11", }, { "ID": "E*O*DL----*****", "D": "Secret Service", "DC": "8", "H": "6.X.3.4.12", }, { "ID": "E*O*DLA---*****", "D": "Secret Service Unit", "DC": "8", "H": "6.X.3.4.12.1", }, { "ID": "E*O*DLB---*****", "D": "Secret Service Equipment", "DC": "8", "H": "6.X.3.4.12.2", }, { "ID": "E*O*DLC---H****", "D": "Secret Service Installation", "DC": "8", "H": "6.X.3.4.12.3", }, { "ID": "E*O*DM----*****", "D": "TSA", "DC": "8", "H": "6.X.3.4.13", }, { "ID": "E*O*DMA---*****", "D": "TSA Unit", "DC": "8", "H": "6.X.3.4.13.1", }, { "ID": "E*O*DMB---*****", "D": "TSA Equipment", "DC": "8", "H": "6.X.3.4.13.2", }, { "ID": "E*O*DMC---H****", "D": "TSA Installation", "DC": "8", "H": "6.X.3.4.13.3", }, { "ID": "E*O*DN----*****", "D": "Coast Guard", "DC": "8", "H": "6.X.3.4.14", }, { "ID": "E*O*DNA---*****", "D": "Coast Guard Unit", "DC": "8", "H": "6.X.3.4.14.1", }, { "ID": "S*S*XL----*****", "D": "Coast Guard Equipment", "DC": "8", "H": "6.X.3.4.14.2", }, { "ID": "E*O*DNC---H****", "D": "Coast Guard Installation", "DC": "8", "H": "6.X.3.4.14.3", }, { "ID": "E*O*DO----*****", "D": "US Marshals Service", "DC": "8", "H": "6.X.3.4.15", }, { "ID": "E*O*DOA---*****", "D": "US Marshals Service Unit", "DC": "8", "H": "6.X.3.4.15.1", }, { "ID": "E*O*DOB---*****", "D": "US Marshals Service Equipment", "DC": "8", "H": "6.X.3.4.15.2", }, { "ID": "E*O*DOC---H****", "D": "US Marshals Service Installation", "DC": "8", "H": "6.X.3.4.15.3", }, { "ID": "S*G*ES----*****", "D": "Sensor", "DC": "8", "H": "6.X.3.5", }, { "ID": "E*O*EA----*****", "D": "Biological Sensor", "DC": "8", "H": "6.X.3.5.1", }, { "ID": "E*O*EB----*****", "D": "Chemical Sensor", "DC": "8", "H": "6.X.3.5.2", }, { "ID": "E*O*EC----*****", "D": "Intrusion Sensor", "DC": "8", "H": "6.X.3.5.3", }, { "ID": "E*O*ED----*****", "D": "Nuclear Sensor", "DC": "8", "H": "6.X.3.5.4", }, { "ID": "E*O*EE----*****", "D": "Radiological Sensor", "DC": "8", "H": "6.X.3.5.5", }, { "ID": "E*F*------H****", "D": "Infrastructure", "DC": "0", "H": "6.X.4", }, { "ID": "E*F*A-----H****", "D": "Agriculture and Food Infrastructure", "DC": "8", "H": "6.X.4.1", }, { "ID": "E*F*AA----H****", "D": "Agricultural Laboratory", "DC": "8", "H": "6.X.4.1.1", }, { "ID": "E*F*AB----H****", "D": "Animal Feedlot", "DC": "8", "H": "6.X.4.1.2", }, { "ID": "E*F*AC----H****", "D": "Commercial Food Distribution Center", "DC": "8", "H": "6.X.4.1.3", }, { "ID": "E*F*AD----H****", "D": "Farm/Ranch", "DC": "8", "H": "6.X.4.1.4", }, { "ID": "E*F*AE----H****", "D": "Food Production Center", "DC": "8", "H": "6.X.4.1.5", }, { "ID": "E*F*AF----H****", "D": "Food Retail", "DC": "8", "H": "6.X.4.1.6", }, { "ID": "E*F*AG----H****", "D": "Grain Storage", "DC": "8", "H": "6.X.4.1.7", }, { "ID": "E*F*B-----H****", "D": "Banking Finance and Insurance Infrastructure", "DC": "8", "H": "6.X.4.2", }, { "ID": "E*F*BA----*****", "D": "ATM", "DC": "8", "H": "6.X.4.2.1", }, { "ID": "E*F*BB----H****", "D": "Bank", "DC": "8", "H": "6.X.4.2.2", }, { "ID": "E*F*BC----H****", "D": "Bullion Storage", "DC": "8", "H": "6.X.4.2.3", }, { "ID": "E*F*BD----H****", "D": "Federal Reserve Bank", "DC": "8", "H": "6.X.4.2.4", }, { "ID": "E*F*BE----H****", "D": "Financial Exchange", "DC": "8", "H": "6.X.4.2.5", }, { "ID": "E*F*BF----H****", "D": "Financial Services Other", "DC": "8", "H": "6.X.4.2.6", }, { "ID": "E*F*C-----H****", "D": "Commercial Infrastructure", "DC": "8", "H": "6.X.4.3", }, { "ID": "E*F*CA----H****", "D": "Chemical Plant", "DC": "8", "H": "6.X.4.3.1", }, { "ID": "E*F*CB----H****", "D": "Firearms Manufacturer", "DC": "8", "H": "6.X.4.3.2", }, { "ID": "E*F*CC----H****", "D": "Firearms Retailer", "DC": "8", "H": "6.X.4.3.3", }, { "ID": "E*F*CD----H****", "D": "Hazardous Material Production", "DC": "8", "H": "6.X.4.3.4", }, { "ID": "E*F*CE----H****", "D": "Hazardous Material Storage", "DC": "8", "H": "6.X.4.3.5", }, { "ID": "E*F*CF----H****", "D": "Industrial Site", "DC": "8", "H": "6.X.4.3.6", }, { "ID": "E*F*CG----*****", "D": "Landfill", "DC": "8", "H": "6.X.4.3.7", }, { "ID": "E*F*CH----H****", "D": "Pharmaceutical Manufacturer", "DC": "8", "H": "6.X.4.3.8", }, { "ID": "E*F*CI----H****", "D": "Contaminated Hazardous Waste Site", "DC": "8", "H": "6.X.4.3.9", }, { "ID": "E*F*CJ----H****", "D": "Toxic Release Inventory", "DC": "8", "H": "6.X.4.3.10", }, { "ID": "E*F*D-----H****", "D": "Educational Facilties Infrastructure", "DC": "8", "H": "6.X.4.4", }, { "ID": "E*F*DA----H****", "D": "College University", "DC": "8", "H": "6.X.4.4.1", }, { "ID": "E*F*DB----H****", "D": "School", "DC": "8", "H": "6.X.4.4.2", }, { "ID": "S*G*IUE---H****", "D": "Energy Facilities Infrastructure", "DC": "8", "H": "6.X.4.5", }, { "ID": "E*F*EA----H****", "D": "Generation Station", "DC": "8", "H": "6.X.4.5.1", }, { "ID": "E*F*EB----H****", "D": "Natural Gas Facility", "DC": "8", "H": "6.X.4.5.2", }, { "ID": "S*G*IUEN--H****", "D": "Nuclear Facility", "DC": "8", "H": "6.X.4.5.3", }, { "ID": "S*G*IRP---*****", "D": "Petrolium Facility", "DC": "8", "H": "6.X.4.5.4", }, { "ID": "E*F*EE----H****", "D": "Propane Facility", "DC": "8", "H": "6.X.4.5.5", }, { "ID": "E*F*F-----H****", "D": "Government Site Infrastructure", "DC": "8", "H": "6.X.4.6", }, { "ID": "E*F*G-----H****", "D": "Military Infrastructure", "DC": "8", "H": "6.X.4.7", }, { "ID": "E*F*GA----H****", "D": "Military Armory", "DC": "8", "H": "6.X.4.7.1", }, { "ID": "S*G*IB----H****", "D": "Military Base", "DC": "8", "H": "6.X.4.7.2", }, { "ID": "E*F*H-----H****", "D": "Postal Service Infrastructure", "DC": "8", "H": "6.X.4.8", }, { "ID": "E*F*HA----H****", "D": "Postal Distribution Center", "DC": "8", "H": "6.X.4.8.1", }, { "ID": "E*F*HB----H****", "D": "Post Office", "DC": "8", "H": "6.X.4.8.2", }, { "ID": "E*F*I-----H****", "D": "Public Venues Infrastructure", "DC": "8", "H": "6.X.4.9", }, { "ID": "E*F*IA----H****", "D": "Enclosed Facility", "DC": "8", "H": "6.X.4.9.1", }, { "ID": "E*F*IB----H****", "D": "Open Facility", "DC": "8", "H": "6.X.4.9.2", }, { "ID": "E*F*IC----H****", "D": "Recreational Area", "DC": "8", "H": "6.X.4.9.3", }, { "ID": "E*F*ID----H****", "D": "Religious Institution", "DC": "8", "H": "6.X.4.9.4", }, { "ID": "E*F*J-----H****", "D": "Special Needs Infrastructure", "DC": "8", "H": "6.X.4.10", }, { "ID": "E*F*JA----H****", "D": "Adult Day Care", "DC": "8", "H": "6.X.4.10.1", }, { "ID": "E*F*JB----H****", "D": "Child Day Care", "DC": "8", "H": "6.X.4.10.2", }, { "ID": "E*F*JC----H****", "D": "Elder Care", "DC": "8", "H": "6.X.4.10.3", }, { "ID": "E*F*K-----H****", "D": "Telecommunications Infrastructure", "DC": "8", "H": "6.X.4.11", }, { "ID": "S*G*IUT---H****", "D": "Telecommunications Facility", "DC": "8", "H": "6.X.4.11.1", }, { "ID": "E*F*KB----H****", "D": "Telecommunications Tower", "DC": "8", "H": "6.X.4.11.2", }, { "ID": "S*G*IT----H****", "D": "Transportation Infrastructure", "DC": "8", "H": "6.X.4.12", }, { "ID": "E*F*LA----H****", "D": "Air Traffic Control Facility", "DC": "8", "H": "6.X.4.12.1", }, { "ID": "S*G*IBA---H****", "D": "Airport", "DC": "8", "H": "6.X.4.12.2", }, { "ID": "G*M*BCB---****X", "D": "Bridge", "DC": "8", "H": "6.X.4.12.3", }, { "ID": "E*F*LD----H****", "D": "Bus Station", "DC": "8", "H": "6.X.4.12.4", }, { "ID": "E*F*LE----H****", "D": "Ferry Terminal", "DC": "8", "H": "6.X.4.12.5", }, { "ID": "E*F*LF----H****", "D": "Helicopter Landing Site", "DC": "8", "H": "6.X.4.12.6", }, { "ID": "WOS-ML----P----", "D": "Lock", "DC": "8", "H": "6.X.4.12.7", }, { "ID": "E*F*LH----H****", "D": "Maintenance Facility", "DC": "8", "H": "6.X.4.12.8", }, { "ID": "S*G*IBN---H****", "D": "Port", "DC": "8", "H": "6.X.4.12.9", }, { "ID": "E*F*LJ----H****", "D": "Rail Station", "DC": "8", "H": "6.X.4.12.10", }, { "ID": "E*F*LK----H****", "D": "Rest Stop", "DC": "8", "H": "6.X.4.12.11", }, { "ID": "WOS-HPBA--P----", "D": "Ship Anchorage", "DC": "8", "H": "6.X.4.12.12", }, { "ID": "E*F*LM----H****", "D": "Toll Facility", "DC": "8", "H": "6.X.4.12.13", }, { "ID": "G*S*PO----****X", "D": "Traffic Control Point", "DC": "8", "H": "6.X.4.12.14", }, { "ID": "E*F*LO----H****", "D": "Traffic Inspection Facility", "DC": "8", "H": "6.X.4.12.15", }, { "ID": "E*F*LP----H****", "D": "Tunnel", "DC": "8", "H": "6.X.4.12.16", }, { "ID": "S*G*IUP---H****", "D": "Water Supply Infrastructure", "DC": "8", "H": "6.X.4.13", }, { "ID": "E*F*MA----H****", "D": "Control Valve", "DC": "8", "H": "6.X.4.13.1", }, { "ID": "E*F*MB----H****", "D": "Dam", "DC": "8", "H": "6.X.4.13.2", }, { "ID": "E*F*MC----H****", "D": "Discharge Outfall", "DC": "8", "H": "6.X.4.13.3", }, { "ID": "E*F*MD----H****", "D": "Ground Water Well", "DC": "8", "H": "6.X.4.13.4", }, { "ID": "E*F*ME----H****", "D": "Pumping Station", "DC": "8", "H": "6.X.4.13.5", }, { "ID": "E*F*MF----H****", "D": "Reservoir", "DC": "8", "H": "6.X.4.13.6", }, { "ID": "E*F*MG----H****", "D": "Storage Tower", "DC": "8", "H": "6.X.4.13.7", }, { "ID": "E*F*MH----H****", "D": "Surface Water Intake", "DC": "8", "H": "6.X.4.13.8", }, { "ID": "E*F*MI----H****", "D": "Wastewater Treatment Facility", "DC": "8", "H": "6.X.4.13.9", } ] } }; ======================= File: web/js/src/sec/sun/awt/geom/Curve.js ======================= <gh_stars>10-100 var sec = sec || {}; sec.sun = sec.sun || {}; sec.sun.awt = sec.sun.awt || {}; sec.sun.awt.geom = sec.sun.awt.geom || {}; sec.sun.awt.geom.Curve = function() { }; sec.sun.awt.geom.Curve.insertMove = function(curves, x, y) { curves.add(new sec.sun.awt.geom.Order0(x, y)); }; sec.sun.awt.geom.Curve.insertLine = function(curves, x0, y0, x1, y1) { if (y0 === y1) { return; } else if (y0 < y1) { curves.add(new sec.sun.awt.geom.Order1(x0, y0, x1, y1, 1)); } else if (y0 > y1) { curves.add(new sec.sun.awt.geom.Order1(x1, y1, x0, y0, -1)); } }; sec.sun.awt.geom.Curve.insertQuad = function(curves, x0, y0, coords) { var y1 = coords[3]; if (y0 > y1) { sec.sun.awt.geom.Order2.insert(curves, coords, coords[2], y1, coords[0], coords[1], x0, y0, -1); } else if (y0 === y1 && y0 === coords[1]) { return; } else { sec.sun.awt.geom.Order2.insert(curves, coords, x0, y0, coords[0], coords[1], coords[2], y1, 1); } }; sec.sun.awt.geom.Curve.insertCubic = function(curves, x0, y0, coords) { var y1 = coords[5]; if (y0 > y1) { sec.sun.awt.geom.Order3.insert(curves, coords, coords[4], y1, coords[2], coords[3], coords[0], coords[1], x0, y0, -1); } else if (y0 === y1 && y0 === coords[1] && y0 === coords[3]) { return; } else { sec.sun.awt.geom.Order3.insert(curves, coords, x0, y0, coords[0], coords[1], coords[2], coords[3], coords[4], y1, 1); } }; sec.sun.awt.geom.Curve.pointCrossingsForPath = function(pi, px, py) { if (pi.isDone()) { return 0; } var coords = Clazz.newArray(6, 0); if (pi.currentSegment(coords)!== 0) { return -1; } pi.next(); var movx = coords[0]; var movy = coords[1]; var curx = movx; var cury = movy; var endx; var endy; var crossings = 0; while (!pi.isDone()) { switch (pi.currentSegment(coords)) { case 0: if (cury!== movy) { crossings += sec.sun.awt.geom.Curve.pointCrossingsForLine(px, py, curx, cury, movx, movy); } movx = curx = coords[0]; movy = cury = coords[1]; break; case 1: endx = coords[0]; endy = coords[1]; crossings += sec.sun.awt.geom.Curve.pointCrossingsForLine(px, py, curx, cury, endx, endy); curx = endx; cury = endy; break; case 2: endx = coords[2]; endy = coords[3]; crossings += sec.sun.awt.geom.Curve.pointCrossingsForQuad(px, py, curx, cury, coords[0], coords[1], endx, endy, 0); curx = endx; cury = endy; break; case 3: endx = coords[4]; endy = coords[5]; crossings += sec.sun.awt.geom.Curve.pointCrossingsForCubic(px, py, curx, cury, coords[0], coords[1], coords[2], coords[3], endx, endy, 0); curx = endx; cury = endy; break; case 4: if (cury!== movy) { crossings += sec.sun.awt.geom.Curve.pointCrossingsForLine(px, py, curx, cury, movx, movy); } curx = movx; cury = movy; break; } pi.next(); } if (cury!== movy) { crossings += sec.sun.awt.geom.Curve.pointCrossingsForLine(px, py, curx, cury, movx, movy); } return crossings; }; sec.sun.awt.geom.Curve.pointCrossingsForLine = function(px, py, x0, y0, x1, y1) { if (py < y0 && py < y1) return 0; if (py >= y0 && py >= y1) return 0; if (px >= x0 && px >= x1) return 0; if (px < x0 && px < x1) return (y0 < y1)? 1 : -1; var xintercept = x0 + (py - y0) * (x1 - x0) / (y1 - y0); if (px >= xintercept) return 0; return (y0 < y1)? 1 : -1; }; sec.sun.awt.geom.Curve.pointCrossingsForQuad = function(px, py, x0, y0, xc, yc, x1, y1, level) { if (py < y0 && py < yc && py < y1) return 0; if (py >= y0 && py >= yc && py >= y1) return 0; if (px >= x0 && px >= xc && px >= x1) return 0; if (px < x0 && px < xc && px < x1) { if (py >= y0) { if (py < y1) return 1; } else { if (py >= y1) return -1; } return 0; } if (level > 52) return sec.sun.awt.geom.Curve.pointCrossingsForLine(px, py, x0, y0, x1, y1); var x0c = (x0 + xc) / 2; var y0c = (y0 + yc) / 2; var xc1 = (xc + x1) / 2; var yc1 = (yc + y1) / 2; xc = (x0c + xc1) / 2; yc = (y0c + yc1) / 2; if (Double.isNaN(xc) || Double.isNaN(yc)) { return 0; } return (sec.sun.awt.geom.Curve.pointCrossingsForQuad(px, py, x0, y0, x0c, y0c, xc, yc, level + 1) + sec.sun.awt.geom.Curve.pointCrossingsForQuad(px, py, xc, yc, xc1, yc1, x1, y1, level + 1)); }; sec.sun.awt.geom.Curve.pointCrossingsForCubic = function(px, py, x0, y0, xc0, yc0, xc1, yc1, x1, y1, level) { if (py < y0 && py < yc0 && py < yc1 && py < y1) return 0; if (py >= y0 && py >= yc0 && py >= yc1 && py >= y1) return 0; if (px >= x0 && px >= xc0 && px >= xc1 && px >= x1) return 0; if (px < x0 && px < xc0 && px < xc1 && px < x1) { if (py >= y0) { if (py < y1) return 1; } else { if (py >= y1) return -1; } return 0; } if (level > 52) return sec.sun.awt.geom.Curve.pointCrossingsForLine(px, py, x0, y0, x1, y1); var xmid = (xc0 + xc1) / 2; var ymid = (yc0 + yc1) / 2; xc0 = (x0 + xc0) / 2; yc0 = (y0 + yc0) / 2; xc1 = (xc1 + x1) / 2; yc1 = (yc1 + y1) / 2; var xc0m = (xc0 + xmid) / 2; var yc0m = (yc0 + ymid) / 2; var xmc1 = (xmid + xc1) / 2; var ymc1 = (ymid + yc1) / 2; xmid = (xc0m + xmc1) / 2; ymid = (yc0m + ymc1) / 2; if (Double.isNaN(xmid) || Double.isNaN(ymid)) { return 0; } return (sec.sun.awt.geom.Curve.pointCrossingsForCubic(px, py, x0, y0, xc0, yc0, xc0m, yc0m, xmid, ymid, level + 1) + sec.sun.awt.geom.Curve.pointCrossingsForCubic(px, py, xmid, ymid, xmc1, ymc1, xc1, yc1, x1, y1, level + 1)); }; sec.sun.awt.geom.Curve.rectCrossingsforPath = function(pi, rxmin, rymin, rxmax, rymax) { if (rxmax <= rxmin || rymax <= rymin) { return 0; } if (pi.isDone()) { return 0; } var coords = Clazz.newArray(6, 0); if (pi.currentSegment(coords)!== 0) { return -1; } pi.next(); var curx; var cury; var movx; var movy; var endx; var endy; curx = movx = coords[0]; cury = movy = coords[1]; var crossings = 0; while (crossings!== -2147483648 &&!pi.isDone()) { switch (pi.currentSegment(coords)) { case 0: if (curx!== movx || cury!== movy) { crossings = sec.sun.awt.geom.Curve.rectCrossingsForLine(crossings, rxmin, rymin, rxmax, rymax, curx, cury, movx, movy); } movx = curx = coords[0]; movy = cury = coords[1]; break; case 1: endx = coords[0]; endy = coords[1]; crossings = sec.sun.awt.geom.Curve.rectCrossingsForLine(crossings, rxmin, rymin, rxmax, rymax, curx, cury, endx, endy); curx = endx; cury = endy; break; case 2: endx = coords[2]; endy = coords[3]; crossings = sec.sun.awt.geom.Curve.rectCrossingsForQuad(crossings, rxmin, rymin, rxmax, rymax, curx, cury, coords[0], coords[1], endx, endy, 0); curx = endx; cury = endy; break; case 3: endx = coords[4]; endy = coords[5]; crossings = sec.sun.awt.geom.Curve.rectCrossingsForCubic(crossings, rxmin, rymin, rxmax, rymax, curx, cury, coords[0], coords[1], coords[2], coords[3], endx, endy, 0); curx = endx; cury = endy; break; case 4: if (curx!== movx || cury!== movy) { crossings = sec.sun.awt.geom.Curve.rectCrossingsForLine(crossings, rxmin, rymin, rxmax, rymax, curx, cury, movx, movy); } curx = movx; cury = movy; break; } pi.next(); } if (crossings!== -2147483648 && (curx!== movx || cury!== movy)) { crossings = sec.sun.awt.geom.Curve.rectCrossingsForLine(crossings, rxmin, rymin, rxmax, rymax, curx, cury, movx, movy); } return crossings; }; sec.sun.awt.geom.Curve.rectCrossingsForLine = function(crossings, rxmin, rymin, rxmax, rymax, x0, y0, x1, y1) { if (y0 >= rymax && y1 >= rymax) return crossings; if (y0 <= rymin && y1 <= rymin) return crossings; if (x0 <= rxmin && x1 <= rxmin) return crossings; if (x0 >= rxmax && x1 >= rxmax) { if (y0 < y1) { if (y0 <= rymin) crossings++; if (y1 >= rymax) crossings++; } else if (y1 < y0) { if (y1 <= rymin) crossings--; if (y0 >= rymax) crossings--; } return crossings; } if ((x0 > rxmin && x0 < rxmax && y0 > rymin && y0 < rymax) || (x1 > rxmin && x1 < rxmax && y1 > rymin && y1 < rymax)) { return -2147483648; } var xi0 = x0; if (y0 < rymin) { xi0 += ((rymin - y0) * (x1 - x0) / (y1 - y0)); } else if (y0 > rymax) { xi0 += ((rymax - y0) * (x1 - x0) / (y1 - y0)); } var xi1 = x1; if (y1 < rymin) { xi1 += ((rymin - y1) * (x0 - x1) / (y0 - y1)); } else if (y1 > rymax) { xi1 += ((rymax - y1) * (x0 - x1) / (y0 - y1)); } if (xi0 <= rxmin && xi1 <= rxmin) return crossings; if (xi0 >= rxmax && xi1 >= rxmax) { if (y0 < y1) { if (y0 <= rymin) crossings++; if (y1 >= rymax) crossings++; } else if (y1 < y0) { if (y1 <= rymin) crossings--; if (y0 >= rymax) crossings--; } return crossings; } return -2147483648; }; sec.sun.awt.geom.Curve.rectCrossingsForQuad = function(crossings, rxmin, rymin, rxmax, rymax, x0, y0, xc, yc, x1, y1, level) { if (y0 >= rymax && yc >= rymax && y1 >= rymax) return crossings; if (y0 <= rymin && yc <= rymin && y1 <= rymin) return crossings; if (x0 <= rxmin && xc <= rxmin && x1 <= rxmin) return crossings; if (x0 >= rxmax && xc >= rxmax && x1 >= rxmax) { if (y0 < y1) { if (y0 <= rymin && y1 > rymin) crossings++; if (y0 < rymax && y1 >= rymax) crossings++; } else if (y1 < y0) { if (y1 <= rymin && y0 > rymin) crossings--; if (y1 < rymax && y0 >= rymax) crossings--; } return crossings; } if ((x0 < rxmax && x0 > rxmin && y0 < rymax && y0 > rymin) || (x1 < rxmax && x1 > rxmin && y1 < rymax && y1 > rymin)) { return -2147483648; } if (level > 52) { return sec.sun.awt.geom.Curve.rectCrossingsForLine(crossings, rxmin, rymin, rxmax, rymax, x0, y0, x1, y1); } var x0c = (x0 + xc) / 2; var y0c = (y0 + yc) / 2; var xc1 = (xc + x1) / 2; var yc1 = (yc + y1) / 2; xc = (x0c + xc1) / 2; yc = (y0c + yc1) / 2; if (Double.isNaN(xc) || Double.isNaN(yc)) { return 0; } crossings = sec.sun.awt.geom.Curve.rectCrossingsForQuad(crossings, rxmin, rymin, rxmax, rymax, x0, y0, x0c, y0c, xc, yc, level + 1); if (crossings!== -2147483648) { crossings = sec.sun.awt.geom.Curve.rectCrossingsForQuad(crossings, rxmin, rymin, rxmax, rymax, xc, yc, xc1, yc1, x1, y1, level + 1); } return crossings; }; sec.sun.awt.geom.Curve.rectCrossingsForCubic = function(crossings, rxmin, rymin, rxmax, rymax, x0, y0, xc0, yc0, xc1, yc1, x1, y1, level) { if (y0 >= rymax && yc0 >= rymax && yc1 >= rymax && y1 >= rymax) { return crossings; } if (y0 <= rymin && yc0 <= rymin && yc1 <= rymin && y1 <= rymin) { return crossings; } if (x0 <= rxmin && xc0 <= rxmin && xc1 <= rxmin && x1 <= rxmin) { return crossings; } if (x0 >= rxmax && xc0 >= rxmax && xc1 >= rxmax && x1 >= rxmax) { if (y0 < y1) { if (y0 <= rymin && y1 > rymin) crossings++; if (y0 < rymax && y1 >= rymax) crossings++; } else if (y1 < y0) { if (y1 <= rymin && y0 > rymin) crossings--; if (y1 < rymax && y0 >= rymax) crossings--; } return crossings; } if ((x0 > rxmin && x0 < rxmax && y0 > rymin && y0 < rymax) || (x1 > rxmin && x1 < rxmax && y1 > rymin && y1 < rymax)) { return -2147483648; } if (level > 52) { return sec.sun.awt.geom.Curve.rectCrossingsForLine(crossings, rxmin, rymin, rxmax, rymax, x0, y0, x1, y1); } var xmid = (xc0 + xc1) / 2; var ymid = (yc0 + yc1) / 2; xc0 = (x0 + xc0) / 2; yc0 = (y0 + yc0) / 2; xc1 = (xc1 + x1) / 2; yc1 = (yc1 + y1) / 2; var xc0m = (xc0 + xmid) / 2; var yc0m = (yc0 + ymid) / 2; var xmc1 = (xmid + xc1) / 2; var ymc1 = (ymid + yc1) / 2; xmid = (xc0m + xmc1) / 2; ymid = (yc0m + ymc1) / 2; if (Double.isNaN(xmid) || Double.isNaN(ymid)) { return 0; } crossings = sec.sun.awt.geom.Curve.rectCrossingsForCubic(crossings, rxmin, rymin, rxmax, rymax, x0, y0, xc0, yc0, xc0m, yc0m, xmid, ymid, level + 1); if (crossings!== -2147483648) { crossings = sec.sun.awt.geom.Curve.rectCrossingsForCubic(crossings, rxmin, rymin, rxmax, rymax, xmid, ymid, xmc1, ymc1, xc1, yc1, x1, y1, level + 1); } return crossings; }; sec.sun.awt.geom.Curve.round = function(v) { return v; }; sec.sun.awt.geom.Curve.orderof = function(x1, x2) { if (x1 < x2) { return -1; } if (x1 > x2) { return 1; } return 0; }; sec.sun.awt.geom.Curve.signeddifbits = function(y1, y2) { return (Double.doubleToLongBits(y1) - Double.doubleToLongBits(y2)); }; sec.sun.awt.geom.Curve.diffbits = function(y1, y2) { return Math.abs(Double.doubleToLongBits(y1) - Double.doubleToLongBits(y2)); }; sec.sun.awt.geom.Curve.prev = function(v) { return Double.longBitsToDouble(Double.doubleToLongBits(v) - 1); }; sec.sun.awt.geom.Curve.next = function(v) { return Double.longBitsToDouble(Double.doubleToLongBits(v) + 1); }; sec.sun.awt.geom.Curve.fairlyClose = function(v1, v2) { return (Math.abs(v1 - v2) < Math.max(Math.abs(v1), Math.abs(v2)) * 1E-10); }; sec.sun.awt.geom.Curve.solveQuadratic = function(eqn, res) { var a = eqn[2]; var b = eqn[1]; var c = eqn[0]; var roots = 0; if (a === 0.0) { if (b === 0.0) { return -1; } res[roots++] = -c / b; } else { var d = b * b - 4.0 * a * c; if (d < 0.0) { return 0; } d = Math.sqrt(d); if (b < 0.0) { d = -d; } var q = (b + d) / -2.0; res[roots++] = q / a; if (q!== 0.0) { res[roots++] = c / q; } } return roots; }; sec.sun.awt.geom.Curve.INCREASING = 1; sec.sun.awt.geom.Curve.DECREASING = -1; sec.sun.awt.geom.Curve.RECT_INTERSECTS = 0x80000000; sec.sun.awt.geom.Curve.TMIN = 1E-3; ======================= File: web/js/src/armyc2/c2sd/renderer/utilities/MilStdAttributes.js ======================= var armyc2 = armyc2 || {}; /** namespace */ armyc2.c2sd = armyc2.c2sd || {}; armyc2.c2sd.renderer = armyc2.c2sd.renderer || {}; armyc2.c2sd.renderer.utilities = armyc2.c2sd.renderer.utilities || {}; armyc2.c2sd.renderer.utilities.MilStdAttributes = armyc2.c2sd.renderer.utilities.MilStdAttributes || {}; armyc2.c2sd.renderer.utilities.MilStdAttributes.LineColor = "LINECOLOR"; armyc2.c2sd.renderer.utilities.MilStdAttributes.FillColor = "FILLCOLOR"; armyc2.c2sd.renderer.utilities.MilStdAttributes.IconColor = "ICONCOLOR"; armyc2.c2sd.renderer.utilities.MilStdAttributes.TextColor = "TEXTCOLOR"; armyc2.c2sd.renderer.utilities.MilStdAttributes.TextBackgroundColor = "TEXTBACKGROUNDCOLOR"; armyc2.c2sd.renderer.utilities.MilStdAttributes.Alpha = "ALPHA"; armyc2.c2sd.renderer.utilities.MilStdAttributes.LineWidth = "LINEWIDTH"; armyc2.c2sd.renderer.utilities.MilStdAttributes.PixelSize = "SIZE"; armyc2.c2sd.renderer.utilities.MilStdAttributes.KeepUnitRatio = "KEEPUNITRATIO"; armyc2.c2sd.renderer.utilities.MilStdAttributes.SymbologyStandard = "SYMSTD"; armyc2.c2sd.renderer.utilities.MilStdAttributes.Icon = "ICON"; armyc2.c2sd.renderer.utilities.MilStdAttributes.LookAtTag = "LOOKAT"; armyc2.c2sd.renderer.utilities.MilStdAttributes.AltitudeMode = "ALTMODE"; armyc2.c2sd.renderer.utilities.MilStdAttributes.UseDashArray = "USEDASHARRAY"; armyc2.c2sd.renderer.utilities.MilStdAttributes.UsePatternFill = "USEPATTERNFILL"; armyc2.c2sd.renderer.utilities.MilStdAttributes.PatternFillType = "PATTERNFILLTYPE"; armyc2.c2sd.renderer.utilities.MilStdAttributes.HideOptionalLabels = "HIDEOPTIONALLABELS";//azimuth and range labels for range fans. armyc2.c2sd.renderer.utilities.MilStdAttributes.SVGFormat = "SVGFORMAT";//0 plain SVG, 1 base64 (default), 2 % notation armyc2.c2sd.renderer.utilities.MilStdAttributes.GeoJSONFormat = "GJFORMAT";//0 JSON formatted String (default), 1 Object ======================= File: web/js/src/armyc2/c2sd/JavaLineArray/arraysupport.js ======================= <reponame>jiinwoojin/mil-sym-js var armyc2 = armyc2 || {}; armyc2.c2sd = armyc2.c2sd || {}; armyc2.c2sd.JavaLineArray = armyc2.c2sd.JavaLineArray || {}; armyc2.c2sd.JavaLineArray.arraysupport = { /* * used for Depth Area to determine how sharp the polygon corners are. */ getMinBeta: function (pLinePoints) { var minBeta = Math.PI; try { var j = 0; var n = pLinePoints.length; var pt0 = null, pt1 = null, pt2 = null; var theta0 = 1, theta1 = 1, beta = 1; for (j = 1; j < pLinePoints.length - 1; j++) { pt0 = pLinePoints[j - 1]; pt1 = pLinePoints[j]; pt2 = pLinePoints[j + 1]; if (pt0.x === pt1.x && pt0.y === pt1.y) continue; if (pt1.x === pt2.x && pt1.y === pt2.y) continue; theta0 = Math.atan2(pt0.y - pt1.y, pt0.x - pt1.x); theta1 = Math.atan2(pt2.y - pt1.y, pt2.x - pt1.x); beta = Math.abs(theta1 - theta0); if (beta < minBeta) minBeta = beta; } pt0 = pLinePoints[n - 2]; pt1 = pLinePoints[0]; pt2 = pLinePoints[1]; if (pt0.x === pt1.x && pt0.y === pt1.y) return minBeta; if (pt1.x === pt2.x && pt1.y === pt2.y) return minBeta; theta0 = Math.atan2(pt0.y - pt1.y, pt0.x - pt1.x); theta1 = Math.atan2(pt2.y - pt1.y, pt2.x - pt1.x); beta = Math.abs(theta1 - theta0); if (beta < minBeta) minBeta = beta; } catch (exc) { if (Clazz.instanceOf(exc)) { armyc2.c2sd.renderer.utilities.ErrorLogger.LogException(armyc2.c2sd.JavaLineArray.arraysupport._className, "getMinTheta", new armyc2.c2sd.renderer.utilities.RendererException("getMinTheta " + Integer.toString(lineType), exc)); } else { throw exc; } } return minBeta; }, // setMinLength: function (value) // { // minLength = value; // }, FillPoints: function (pLinePoints, counter, points) { points.clear(); for (var j = 0; j < counter; j++) { points.add(pLinePoints[j]); } }, GetLineArray2: function (lineType, pts, shapes, clipBounds, rev, converter) { var points = null; try { var pt = null; var pLinePoints2 = null; var pLinePoints = null; var vblSaveCounter = pts.size(); var j = 0; if (pLinePoints2 === null || pLinePoints2.length === 0) { pLinePoints = new Array(vblSaveCounter); for (j = 0; j < vblSaveCounter; j++) { pt = pts.get(j); pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt.x, pt.y, pt.style); } } var vblCounter = armyc2.c2sd.JavaLineArray.countsupport.GetCountersDouble(lineType, vblSaveCounter, pLinePoints, clipBounds, rev); if (vblCounter > 0) pLinePoints = new Array(vblCounter); else { shapes = null; return null; } armyc2.c2sd.JavaLineArray.lineutility.InitializePOINT2Array(pLinePoints); if (vblSaveCounter > pts.size()) vblSaveCounter = pts.size(); if (vblSaveCounter > pLinePoints.length) vblSaveCounter = pLinePoints.length; for (j = 0; j < vblSaveCounter; j++) { pt = pts.get(j); pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt.x, pt.y, pt.style); } var useConverter=false; useConverter=true; if(!useConverter) converter=undefined; points = armyc2.c2sd.JavaLineArray.arraysupport.GetLineArray2Double(lineType, pLinePoints, vblCounter, vblSaveCounter, shapes, clipBounds, rev, converter); } catch (exc) { if (Clazz.instanceOf(exc)) { armyc2.c2sd.renderer.utilities.ErrorLogger.LogException(armyc2.c2sd.JavaLineArray.arraysupport._className, "GetLineArray2", new armyc2.c2sd.renderer.utilities.RendererException("GetLineArray2 " + Integer.toString(lineType), exc)); } else { throw exc; } } return points; }, GetFORTLPointsDouble: function (pLinePoints, lineType, vblSaveCounter) { var nCounter = 0; try { var j = 0; var k = 0; var bolVertical = 0; var lCount = 0; var dLengthSegment = 0; var dIncrement = 20; var m = new armyc2.c2sd.JavaLineArray.ref(); var pSpikePoints = null; var pt0 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pt1 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); lCount = armyc2.c2sd.JavaLineArray.countsupport.GetFORTLCountDouble(pLinePoints, lineType, vblSaveCounter); var numGlyphs = 0; var dGlyphSize = 0; pSpikePoints = new Array(lCount); armyc2.c2sd.JavaLineArray.lineutility.InitializePOINT2Array(pSpikePoints); switch (lineType) { default: dIncrement = 20; break; } for (j = 0; j < vblSaveCounter - 1; j++) { bolVertical = armyc2.c2sd.JavaLineArray.lineutility.CalcTrueSlopeDouble(pLinePoints[j], pLinePoints[j + 1], m); dLengthSegment = armyc2.c2sd.JavaLineArray.lineutility.CalcDistanceDouble(pLinePoints[j], pLinePoints[j + 1]); if (dLengthSegment / 20 < 1) { pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j]); nCounter++; pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j + 1]); nCounter++; continue; } numGlyphs = Math.floor(dLengthSegment / dIncrement); //dGlyphSize=dIncrement/2; dGlyphSize = 10; dIncrement = (dLengthSegment / numGlyphs); if (dIncrement > 25) { dIncrement = 25; numGlyphs = Math.floor(dLengthSegment / dIncrement); } //for (k = 0; k < dLengthSegment / 20 - 1; k++) { for (k = 0; k < numGlyphs; k++) { pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j + 1], pLinePoints[j], -k * dIncrement, 0); nCounter++; //pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j + 1], pLinePoints[j], -k * dIncrement - 10, 0); pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j + 1], pLinePoints[j], -k * dIncrement - dIncrement / 2, 0); nCounter++; pt0 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pSpikePoints[nCounter - 1]); //pt1 = armyc2.c2sd.JavaLineArray.lineutility.ExtendLineDouble(pLinePoints[j], pSpikePoints[nCounter - 1], 10); pt1 = armyc2.c2sd.JavaLineArray.lineutility.ExtendLineDouble(pLinePoints[j], pSpikePoints[nCounter - 1], dIncrement / 2); if (pLinePoints[j].x > pLinePoints[j + 1].x) { pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pLinePoints[j], pLinePoints[j + 1], pt0, 3, dGlyphSize); nCounter++; pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pLinePoints[j], pLinePoints[j + 1], pt1, 3, dGlyphSize); nCounter++; } if (pLinePoints[j].x < pLinePoints[j + 1].x) { pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pLinePoints[j], pLinePoints[j + 1], pt0, 2, dGlyphSize); nCounter++; pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pLinePoints[j], pLinePoints[j + 1], pt1, 2, dGlyphSize); nCounter++; } if (pLinePoints[j].x === pLinePoints[j + 1].x) { if (pLinePoints[j].y < pLinePoints[j + 1].y) { pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pLinePoints[j], pLinePoints[j + 1], pt0, 1, dGlyphSize); nCounter++; pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pLinePoints[j], pLinePoints[j + 1], pt1, 1, dGlyphSize); nCounter++; } if (pLinePoints[j].y > pLinePoints[j + 1].y) { pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pLinePoints[j], pLinePoints[j + 1], pt0, 0, dGlyphSize); nCounter++; pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pLinePoints[j], pLinePoints[j + 1], pt1, 0, dGlyphSize); nCounter++; } } //pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j], pSpikePoints[nCounter - 3], 10, 0); pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j], pSpikePoints[nCounter - 3], 10, dIncrement / 2); nCounter++; } pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j + 1]); nCounter++; } for (j = 0; j < nCounter; j++) { pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pSpikePoints[j]); } pSpikePoints = null; return nCounter; } catch (exc) { if (Clazz.instanceOf(exc)) { armyc2.c2sd.renderer.utilities.ErrorLogger.LogException(armyc2.c2sd.JavaLineArray.arraysupport._className, "GetFORTLPointsDouble", new armyc2.c2sd.renderer.utilities.RendererException("GetFORTLPointsDouble " + Integer.toString(lineType), exc)); } else { throw exc; } } return nCounter; }, CoordFEBADouble: function (pLinePoints, vblCounter) { try { var j = 0; var pXLinePoints = new Array(Math.floor(4 * vblCounter / 32)); var pNewLinePoints = new Array(Math.floor(vblCounter / 32)); var pShortLinePoints = new Array(Math.floor(2 * vblCounter / 32)); var pArcLinePoints = new Array(Math.floor(26 * vblCounter / 32)); var dPrinter = 1.0; for (j = Math.floor(vblCounter / 32); j < vblCounter; j++) { pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); pLinePoints[j].style = 0; } for (j = 0; j < Math.floor(4 * vblCounter / 32); j++) { pXLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); pXLinePoints[j].style = 0; } for (j = 0; j < Math.floor(vblCounter / 32); j++) { pNewLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j]); pNewLinePoints[j].style = 0; } for (j = 0; j < Math.floor(2 * vblCounter / 32); j++) { pShortLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); pShortLinePoints[j].style = 0; } for (j = 0; j < Math.floor(26 * vblCounter / 32); j++) { pArcLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); pArcLinePoints[j].style = 0; } armyc2.c2sd.JavaLineArray.lineutility.GetXFEBADouble(pNewLinePoints, 10 * dPrinter, Math.floor(vblCounter / 32), pXLinePoints); for (j = 0; j < Math.floor(4 * vblCounter / 32); j++) { pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pXLinePoints[j]); } pLinePoints[Math.floor(4 * vblCounter / 32) - 1].style = 5; for (j = Math.floor(4 * vblCounter / 32); j < Math.floor(6 * vblCounter / 32); j++) { pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pShortLinePoints[j - Math.floor(4 * vblCounter / 32)]); pLinePoints[j].style = 5; } pLinePoints[Math.floor(6 * vblCounter / 32) - 1].style = 5; armyc2.c2sd.JavaLineArray.lineutility.GetArcFEBADouble(14.0 * dPrinter, pNewLinePoints, Math.floor(vblCounter / 32), pArcLinePoints); for (j = Math.floor(6 * vblCounter / 32); j < vblCounter; j++) { pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pArcLinePoints[j - Math.floor(6 * vblCounter / 32)]); } pXLinePoints = null; pNewLinePoints = null; pShortLinePoints = null; pArcLinePoints = null; return; } catch (exc) { if (Clazz.instanceOf(exc)) { armyc2.c2sd.renderer.utilities.ErrorLogger.LogException(armyc2.c2sd.JavaLineArray.arraysupport._className, "CoordFEBADouble", new armyc2.c2sd.renderer.utilities.RendererException("CoordFEBADouble", exc)); } else { throw exc; } } }, GetATWallPointsDouble2: function (pLinePoints, lineType, vblSaveCounter) { var nCounter = 0; try { var j = 0; var k = 0; var lCount = 0; var dLengthSegment = 0; var dIncrement = 0; var pSpikePoints = null; var pt0; var dSpikeSize = 0; var limit = 0, numSpikes = 0 lCount = armyc2.c2sd.JavaLineArray.countsupport.GetFORTLCountDouble(pLinePoints, lineType, vblSaveCounter); pSpikePoints = new Array(lCount); armyc2.c2sd.JavaLineArray.lineutility.InitializePOINT2Array(pSpikePoints); pSpikePoints[nCounter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); for (j = 0; j < vblSaveCounter - 1; j++) { dLengthSegment = armyc2.c2sd.JavaLineArray.lineutility.CalcDistanceDouble(pLinePoints[j], pLinePoints[j + 1]); dIncrement = 20; dSpikeSize = 10; // diagnostic numSpikes = Math.round((dLengthSegment - 10) / dIncrement); dIncrement = dLengthSegment / numSpikes; if (dIncrement > 25) dIncrement = 25; //limit = Math.floor((dLengthSegment / dIncrement)) - 1; limit = numSpikes - 1; // if (limit < 1) { // pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j]); // nCounter++; // pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j + 1]); // nCounter++; // continue; // } // end diagnostic for (k = -1; k < limit; k++) { pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j + 1], pLinePoints[j], -k * dIncrement - 30, 0); nCounter++; pt0 = armyc2.c2sd.JavaLineArray.lineutility.ExtendLineDouble(pLinePoints[j], pSpikePoints[nCounter - 1], dSpikeSize / 2); if (pLinePoints[j].x > pLinePoints[j + 1].x) { pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pLinePoints[j], pSpikePoints[nCounter - 1], pt0, 2, dSpikeSize); } if (pLinePoints[j].x < pLinePoints[j + 1].x) { pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pLinePoints[j], pSpikePoints[nCounter - 1], pt0, 3, dSpikeSize); } if (pLinePoints[j].x === pLinePoints[j + 1].x) { pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt0); if (pLinePoints[j].y < pLinePoints[j + 1].y) { pSpikePoints[nCounter].x = pt0.x - dSpikeSize; } else { pSpikePoints[nCounter].x = pt0.x + dSpikeSize; } } nCounter++; pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j], pSpikePoints[nCounter - 2], dSpikeSize, 0); nCounter++; } pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j + 1]); pSpikePoints[nCounter].style = 0; nCounter++; } for (j = 0; j < nCounter; j++) { pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pSpikePoints[j]); } pSpikePoints = null; } catch (exc) { if (Clazz.instanceOf(exc)) { armyc2.c2sd.renderer.utilities.ErrorLogger.LogException(armyc2.c2sd.JavaLineArray.arraysupport._className, "GetATWallPointsDouble", new armyc2.c2sd.renderer.utilities.RendererException("GetATWallPointsDouble", exc)); } else { throw exc; } } return nCounter; }, GetInsideOutsideDouble2: function (pt0, pt1, pLinePoints, vblCounter, index, lineType) { var nDirection = 0; try { var m = new armyc2.c2sd.JavaLineArray.ref(); var m0 = new armyc2.c2sd.JavaLineArray.ref(); var b0 = 0; var b2 = 0; var b = 0; var X0 = 0; var Y0 = 0; var X = 0; var Y = 0; var nInOutCounter = 0; var j = 0; var bolVertical = 0; var bolVertical2 = 0; var nOrientation = 0; var extendLeft = 0; var extendRight = 1; var extendAbove = 2; var extendBelow = 3; var oppSegment = vblCounter - index - 3; var pt2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); bolVertical = armyc2.c2sd.JavaLineArray.lineutility.CalcTrueSlopeDouble(pt0, pt1, m0); if (m0.value === null) return 0; X0 = (pt0.x + pt1.x) / 2; Y0 = (pt0.y + pt1.y) / 2; if (lineType === 23111001 && oppSegment >= 0 && oppSegment < vblCounter - 1) { X0 = (pLinePoints[oppSegment].x + pLinePoints[oppSegment + 1].x) / 2; Y0 = (pLinePoints[oppSegment].y + pLinePoints[oppSegment + 1].y) / 2; b0 = Y0 + 1 / m0.value[0] * X0; b2 = pt0.y - m0.value[0] * pt0.x; if (m0.value[0]!== 0 && bolVertical!== 0) { pt2 = armyc2.c2sd.JavaLineArray.lineutility.CalcTrueIntersectDouble2(-1 / m0.value[0], b0, m0.value[0], b2, 1, 1, 0, 0); X0 = pt2.x; Y0 = pt2.y; } if (m0.value[0] === 0 && bolVertical!== 0) { X0 = (pLinePoints[oppSegment].x + pLinePoints[oppSegment + 1].x) / 2; Y0 = (pt0.y + pt1.y) / 2; } if (bolVertical === 0) { Y0 = (pLinePoints[oppSegment].y + pLinePoints[oppSegment + 1].y) / 2; X0 = (pt0.x + pt1.x) / 2; } } if (Math.abs(m0.value[0]) >= 1 || bolVertical === 0) { nOrientation = 0; for (j = 0; j < vblCounter - 1; j++) { if (index!== j) { if (lineType === 23111001 && oppSegment!== j) continue; //if ((pLinePoints[j].y <= Y0 && pLinePoints[j + 1].y >= Y0) || (pLinePoints[j].y >= Y0 && pLinePoints[j + 1].y <= Y0)) if ((pLinePoints[j].y < Y0 && pLinePoints[j + 1].y > Y0) || (pLinePoints[j].y > Y0 && pLinePoints[j + 1].y < Y0) || (pLinePoints[j].y < Y0 && pLinePoints[j + 1].y === Y0) || (pLinePoints[j].y === Y0 && pLinePoints[j + 1].y < Y0)) { bolVertical2 = armyc2.c2sd.JavaLineArray.lineutility.CalcTrueSlopeDouble(pLinePoints[j], pLinePoints[j + 1], m); if (bolVertical2 === 1 && m.value[0] === 0) { nInOutCounter++; nInOutCounter--; } if (bolVertical2 === 0) { if (pLinePoints[j].x < X0) { nInOutCounter++; } } if (m.value[0]!== 0 && bolVertical2 === 1) { b = pLinePoints[j].y - m.value[0] * pLinePoints[j].x; X = (Y0 - b) / m.value[0]; if (X < X0) { nInOutCounter++; } } } } } } else { nOrientation = 1; for (j = 0; j < vblCounter - 1; j++) { if (index!== j) { if (lineType === 23111001 && oppSegment!== j) continue; //if ((pLinePoints[j].x <= X0 && pLinePoints[j + 1].x >= X0) || (pLinePoints[j].x >= X0 && pLinePoints[j + 1].x <= X0)) if ((pLinePoints[j].x < X0 && pLinePoints[j + 1].x > X0) || (pLinePoints[j].x > X0 && pLinePoints[j + 1].x < X0) || (pLinePoints[j].x < X0 && pLinePoints[j + 1].x === X0) || (pLinePoints[j].x === X0 && pLinePoints[j + 1].x < X0)) { bolVertical2 = armyc2.c2sd.JavaLineArray.lineutility.CalcTrueSlopeDouble(pLinePoints[j], pLinePoints[j + 1], m); if (bolVertical2 === 0) { nInOutCounter++; nInOutCounter--; } if (bolVertical2 === 1 && m.value[0] === 0) { if (pLinePoints[j].y < Y0) { nInOutCounter++; } } if (m.value[0]!== 0 && bolVertical2 === 1) { b = pLinePoints[j].y - m.value[0] * pLinePoints[j].x; Y = m.value[0] * X0 + b; if (Y < Y0) { nInOutCounter++; } } } } } } switch (nInOutCounter % 2) { case 0: if (nOrientation === 0) { nDirection = extendLeft; } else { nDirection = extendAbove; } break; case 1: if (nOrientation === 0) { nDirection = extendRight; } else { nDirection = extendBelow; } break; default: break; } //reverse direction for ICING switch (lineType) { case 31740000: if (nDirection === extendLeft) nDirection = extendRight; else if (nDirection === extendRight) nDirection = extendLeft; else if (nDirection === extendAbove) nDirection = extendBelow; else if (nDirection === extendBelow) nDirection = extendAbove; break; default: break; } } catch (exc) { if (Clazz.instanceOf(exc)) { armyc2.c2sd.renderer.utilities.ErrorLogger.LogException(armyc2.c2sd.JavaLineArray.arraysupport._className, "GetInsideOutsideDouble2", new armyc2.c2sd.renderer.utilities.RendererException("GetInsideOutsideDouble2", exc)); } else { throw exc; } } return nDirection; }, GetZONEPointsDouble2: function (pLinePoints, lineType, vblSaveCounter) { var nCounter = 0; try { var j = 0; var k = 0; var n = 0; var lCount = 0; var dLengthSegment = 0; var pt0 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); var pt1 = null; var pt2 = null; var pt3 = null; var pSpikePoints = null; var nDirection = 0; lCount = armyc2.c2sd.JavaLineArray.countsupport.GetFORTLCountDouble(pLinePoints, lineType, vblSaveCounter); pSpikePoints = new Array(lCount); armyc2.c2sd.JavaLineArray.lineutility.InitializePOINT2Array(pSpikePoints); var remainder = 0; for (j = 0; j < vblSaveCounter - 1; j++) { pt1 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j]); pt2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j + 1]); nDirection = armyc2.c2sd.JavaLineArray.arraysupport.GetInsideOutsideDouble2(pt1, pt2, pLinePoints, vblSaveCounter, j, lineType); dLengthSegment = armyc2.c2sd.JavaLineArray.lineutility.CalcDistanceDouble(pLinePoints[j], pLinePoints[j + 1]); if (!(lineType === 23111000) &&!(lineType === 23111001)) { if (dLengthSegment < 20) { pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j]); nCounter++; pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j + 1]); nCounter++; continue; } } switch (lineType) { case 23115000: case 23114000: switch (nDirection) { case 0: nDirection = 1; break; case 1: nDirection = 0; break; case 2: nDirection = 3; break; case 3: nDirection = 2; break; default: break; } break; default: break; } n = Math.floor((dLengthSegment / 20)); remainder = dLengthSegment - n * 20; for (k = 0; k < n; k++) { if (k > 0) { pSpikePoints[nCounter++] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j + 1], pLinePoints[j], -k * 20 - remainder / 2, 0); pSpikePoints[nCounter++] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j + 1], pLinePoints[j], -k * 20 - 10 - remainder / 2, 0); } else { pSpikePoints[nCounter++] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j + 1], pLinePoints[j], -k * 20, 0); pSpikePoints[nCounter++] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j + 1], pLinePoints[j], -k * 20 - 10, 0); } switch (lineType) { case 22236000: case 22238000: case 22239000: case 22624000: case 22625000: case 22626000: case 243213100: case 243214100: case 23115000: case 23114000: case 23113000: case 23111000: case 23111001: case 22624000: pt0 = armyc2.c2sd.JavaLineArray.lineutility.ExtendLineDouble(pLinePoints[j], pSpikePoints[nCounter - 1], 5); break; case 23350000: case 22134000: pt0 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pSpikePoints[nCounter - 1]); break; default: break; } pSpikePoints[nCounter++] = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pt1, pt2, pt0, nDirection, 10); switch (lineType) { case 23115000: case 23114000: case 23113000: case 23111000: case 23111001: case 22624000: pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j], pSpikePoints[nCounter - 2], 10, 0); break; case 22236000: case 22238000: case 22239000: case 22624000: case 22625000: case 22626000: case 243213100: case 243214100: case 23350000: pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pSpikePoints[nCounter - 2]); break; case 22134000: pt3 = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j], pSpikePoints[nCounter - 2], 10, 0); pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pt1, pt2, pt3, nDirection, 10); nCounter++; pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt3); break; default: break; } nCounter++; if (lineType === 22624000) pSpikePoints[nCounter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pSpikePoints[nCounter - 4]); } pSpikePoints[nCounter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j + 1]); } for (j = 0; j < nCounter; j++) { if (lineType === 23115000) { pSpikePoints[j].style = 11; } } if (lineType === 23115000) { pSpikePoints[nCounter - 1].style = 12; } else { if (nCounter > 0) pSpikePoints[nCounter - 1].style = 5; } for (j = 0; j < nCounter; j++) { pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pSpikePoints[j]); if (j === nCounter - 1) { if (lineType!== 23115000) { pLinePoints[j].style = 5; } } } pSpikePoints = null; } catch (exc) { if (Clazz.instanceOf(exc)) { armyc2.c2sd.renderer.utilities.ErrorLogger.LogException(armyc2.c2sd.JavaLineArray.arraysupport._className, "GetZONEPointsDouble2", new armyc2.c2sd.renderer.utilities.RendererException("GetZONEPointsDouble2", exc)); } else { throw exc; } } return nCounter; }, IsTurnArcReversed: function (pPoints) { try { if (pPoints.length < 3) { return false; } var ptsSeize = new Array(2); ptsSeize[0] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pPoints[0]); ptsSeize[1] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pPoints[1]); armyc2.c2sd.JavaLineArray.lineutility.CalcClockwiseCenterDouble(ptsSeize); var d = armyc2.c2sd.JavaLineArray.lineutility.CalcDistanceDouble(ptsSeize[0], pPoints[2]); ptsSeize[0] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pPoints[1]); ptsSeize[1] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pPoints[0]); armyc2.c2sd.JavaLineArray.lineutility.CalcClockwiseCenterDouble(ptsSeize); var dArcReversed = armyc2.c2sd.JavaLineArray.lineutility.CalcDistanceDouble(ptsSeize[0], pPoints[2]); ptsSeize = null; if (dArcReversed > d) { return true; } else { return false; } } catch (exc) { if (Clazz.instanceOf(exc)) { armyc2.c2sd.renderer.utilities.ErrorLogger.LogException(armyc2.c2sd.JavaLineArray.arraysupport._className, "IsTurnArcReversed", new armyc2.c2sd.renderer.utilities.RendererException("IsTurnArcReversed", exc)); } else { throw exc; } } return false; }, GetIsolatePointsDouble: function (pLinePoints, lineType, converter) { try { var reverseTurn = false; var pt0 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); var pt1 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[1]); var pt2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); if (pt0.x === pt1.x && pt0.y === pt1.y) pt1.x += 1; var C = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var E = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var midPt = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var j = 0; var k = 0; var l = 0; var ptsArc = new Array(26); var midPts = new Array(7); var trianglePts = new Array(21); var pArrowPoints = new Array(3); var reversepArrowPoints = new Array(3); var dRadius = armyc2.c2sd.JavaLineArray.lineutility.CalcDistanceDouble(pt0, pt1); var dLength = Math.abs(dRadius - 20); if (dRadius < 40) { dLength = dRadius / 1.5; } var d = armyc2.c2sd.JavaLineArray.lineutility.MBRDistance(pLinePoints, 2); var ptsSeize = new Array(2); var savepoints = new Array(3); for (j = 0; j < 2; j++) { savepoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j]); } if (pLinePoints.length >= 3) { savepoints[2] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[2]); } armyc2.c2sd.JavaLineArray.lineutility.InitializePOINT2Array(ptsArc); armyc2.c2sd.JavaLineArray.lineutility.InitializePOINT2Array(midPts); armyc2.c2sd.JavaLineArray.lineutility.InitializePOINT2Array(trianglePts); armyc2.c2sd.JavaLineArray.lineutility.InitializePOINT2Array(pArrowPoints); armyc2.c2sd.JavaLineArray.lineutility.InitializePOINT2Array(reversepArrowPoints); armyc2.c2sd.JavaLineArray.lineutility.InitializePOINT2Array(ptsSeize); if (d / 7 > armyc2.c2sd.JavaLineArray.arraysupport.maxLength) { d = 7 * armyc2.c2sd.JavaLineArray.arraysupport.maxLength; } if (d / 7 < armyc2.c2sd.JavaLineArray.arraysupport.minLength) { d = 7 * armyc2.c2sd.JavaLineArray.arraysupport.minLength; } if (d > 140) d = 140; var ptsArc2 = new Array(26); armyc2.c2sd.JavaLineArray.lineutility.InitializePOINT2Array(ptsArc2); E.x = 2 * pt1.x - pt0.x; E.y = 2 * pt1.y - pt0.y; ptsArc[0] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[1]); ptsArc[1] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(E); if(converter) { ptsArc[0] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); ptsArc[1] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[1]); } armyc2.c2sd.JavaLineArray.lineutility.ArcArrayDouble(ptsArc, 0, dRadius, lineType, converter); for (j = 0; j < 26; j++) { ptsArc[j].style = 0; pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(ptsArc[j]); pLinePoints[j].style = 0; } if (lineType!== 211600000) armyc2.c2sd.JavaLineArray.lineutility.GetArrowHead4Double(ptsArc[24], ptsArc[25], Math.floor(Math.floor(d) / 7), Math.floor(Math.floor(d) / 7), pArrowPoints, 0); else armyc2.c2sd.JavaLineArray.lineutility.GetArrowHead4Double(ptsArc[24], ptsArc[25], Math.floor(Math.floor(d) / 7), Math.floor(Math.floor(1.75 * d) / 7), pArrowPoints, 0); pLinePoints[25].style = 5; switch (lineType) { case 212600000: case 212500000: case 211400000: if (dRadius > 100) dLength = 0.8 * dRadius; for (j = 1; j <= 23; j++) { if (j % 3 === 0) { midPts[k].x = pt0.x - Math.floor(((dLength / dRadius) * (pt0.x - ptsArc[j].x))); midPts[k].y = pt0.y - Math.floor(((dLength / dRadius) * (pt0.y - ptsArc[j].y))); midPts[k].style = 0; trianglePts[l] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(ptsArc[j - 1]); l++; trianglePts[l] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(midPts[k]); l++; trianglePts[l] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(ptsArc[j + 1]); trianglePts[l].style = 5; l++; k++; } } for (j = 26; j < 47; j++) { pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(trianglePts[j - 26]); } pLinePoints[46].style = 5; for (j = 47; j < 50; j++) { pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pArrowPoints[j - 47]); pLinePoints[j].style = 0; } break; case 211600000: midPt.x = (pt1.x + ptsArc[25].x) / 2; midPt.y = (pt1.y + ptsArc[25].y) / 2; armyc2.c2sd.JavaLineArray.lineutility.GetArrowHead4Double(midPt, ptsArc[25], Math.floor(Math.floor(d) / 7), Math.floor(Math.floor(1.75 * d) / 7), reversepArrowPoints, 0); for (j = 26; j < 29; j++) { pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pArrowPoints[j - 26]); } for (j = 29; j < 32; j++) { pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(reversepArrowPoints[j - 29]); pLinePoints[j].style = 0; } break; case 212100000: for (j = 26; j < 29; j++) { pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pArrowPoints[j - 26]); pLinePoints[j].style = 0; } pLinePoints[28].style = 5; break; case 23173000: var changeArc = armyc2.c2sd.JavaLineArray.arraysupport.IsTurnArcReversed(savepoints); if (reverseTurn === true || changeArc === true) { pt0.x = pt1.x; pt0.y = pt1.y; pt1.x = pt2.x; pt1.y = pt2.y; } ptsSeize[0] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt0); ptsSeize[1] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt1); dRadius = armyc2.c2sd.JavaLineArray.lineutility.CalcClockwiseCenterDouble(ptsSeize); C = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(ptsSeize[0]); E = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(ptsSeize[1]); ptsArc[0] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt0); ptsArc[1] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(E); armyc2.c2sd.JavaLineArray.lineutility.ArcArrayDouble(ptsArc, 0, dRadius, lineType); for (j = 0; j < 26; j++) { ptsArc[j].style = 0; pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(ptsArc[j]); pLinePoints[j].style = 0; } if (changeArc === true) { armyc2.c2sd.JavaLineArray.lineutility.GetArrowHead4Double(ptsArc[1], pt0, Math.floor(Math.floor(d) / 7), Math.floor(Math.floor(d) / 7), pArrowPoints, 5); } else { armyc2.c2sd.JavaLineArray.lineutility.GetArrowHead4Double(ptsArc[24], pt1, Math.floor(Math.floor(d) / 7), Math.floor(Math.floor(d) / 7), pArrowPoints, 5); } pLinePoints[25].style = 5; for (j = 26; j < 29; j++) { pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pArrowPoints[j - 26]); pLinePoints[j].style = 9; } pLinePoints[28].style = 10; break; case 211900000: for (j = 26; j < 29; j++) { pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pArrowPoints[j - 26]); pLinePoints[j].style = 0; } pLinePoints[28].style = 5; k = 29; for (j = 1; j < 24; j++) { pLinePoints[k] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(ptsArc[j]); pLinePoints[k].style = 0; k++; pLinePoints[k] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLineDouble(pt0, ptsArc[j], Math.floor(Math.floor(d) / 7)); pLinePoints[k].style = 5; k++; } break; default: break; } savepoints = null; ptsArc = null; midPts = null; trianglePts = null; pArrowPoints = null; reversepArrowPoints = null; ptsSeize = null; ptsArc2 = null; } catch (exc) { if (Clazz.instanceOf(exc)) { armyc2.c2sd.renderer.utilities.ErrorLogger.LogException(armyc2.c2sd.JavaLineArray.arraysupport._className, "GetIsolatePointsDouble", new armyc2.c2sd.renderer.utilities.RendererException("GetIsolatePointsDouble " + Integer.toString(lineType), exc)); } else { throw exc; } } return; }, AreaWithCenterFeatureDouble: function (pLinePoints, vblCounter, lineType) { try { var k = 0; var ptCenter = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var fLength = 4; if (lineType === 221311000) fLength = 5; var d = armyc2.c2sd.JavaLineArray.lineutility.MBRDistance(pLinePoints, vblCounter - fLength); if (d > 350) d = 350; for (k = 0; k < vblCounter; k++) { pLinePoints[k].style = 0; } switch (lineType) { case 2237000: if (d < 20) d = 20; if (d > 60) d = 60; var ul = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var lr = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); armyc2.c2sd.JavaLineArray.lineutility.CalcMBRPoints(pLinePoints, vblCounter - 4, ul, lr); var ur = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(lr); ur.y = ul.y; pLinePoints[vblCounter - 3] = armyc2.c2sd.JavaLineArray.lineutility.MidPointDouble(ur, ul, 0); pLinePoints[vblCounter - 3].x -= d / 2;//25; pLinePoints[vblCounter - 3].y -= d / 5;//10; pLinePoints[vblCounter - 2] = armyc2.c2sd.JavaLineArray.lineutility.MidPointDouble(ur, ul, 0); pLinePoints[vblCounter - 2].y -= d * 0.7;//35; pLinePoints[vblCounter - 1] = armyc2.c2sd.JavaLineArray.lineutility.MidPointDouble(ur, ul, 0); pLinePoints[vblCounter - 1].x += d / 2;//25; pLinePoints[vblCounter - 1].y -= d / 5;//10; pLinePoints[vblCounter - 4].style = 5; break; case 221311000: if (d < 100) d = 100; pLinePoints[vblCounter - 5] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); pLinePoints[vblCounter - 5].style = 5; pLinePoints[vblCounter - 4] = armyc2.c2sd.JavaLineArray.lineutility.CalcCenterPointDouble(pLinePoints, vblCounter - 6); pLinePoints[vblCounter - 4].x -= d / 10; //was 20 pLinePoints[vblCounter - 4].style = 0; pLinePoints[vblCounter - 3] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[vblCounter - 4]); pLinePoints[vblCounter - 3].x = pLinePoints[vblCounter - 4].x + d / 5; //was 10 pLinePoints[vblCounter - 3].style = 5; pLinePoints[vblCounter - 2] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[vblCounter - 4]); pLinePoints[vblCounter - 2].y += d / 20; //was 40 pLinePoints[vblCounter - 2].style = 0; pLinePoints[vblCounter - 1] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[vblCounter - 3]); pLinePoints[vblCounter - 1].y -= d / 20; //was 40 pLinePoints[vblCounter - 1].style = 0; break; case 22340000: if (d < 50) d = 50; if (lineType === 22340000) { for (k = 0; k < vblCounter - 4; k++) { pLinePoints[k].style = 14; } } pLinePoints[vblCounter - 4] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); pLinePoints[vblCounter - 4].style = 5; ptCenter = armyc2.c2sd.JavaLineArray.lineutility.CalcCenterPointDouble(pLinePoints, vblCounter - 4); pLinePoints[vblCounter - 3].x = ptCenter.x - d / 10; pLinePoints[vblCounter - 3].y = ptCenter.y; pLinePoints[vblCounter - 3].style = 18; pLinePoints[vblCounter - 2].x = ptCenter.x; pLinePoints[vblCounter - 2].y = ptCenter.y - d / 10; pLinePoints[vblCounter - 2].style = 18; pLinePoints[vblCounter - 1].x = ptCenter.x + d / 10; pLinePoints[vblCounter - 1].y = ptCenter.y; break; case 22350000: if (d < 50) d = 50; pLinePoints[vblCounter - 4].style = 5; ptCenter = armyc2.c2sd.JavaLineArray.lineutility.CalcCenterPointDouble(pLinePoints, vblCounter - 4); pLinePoints[vblCounter - 3].x = ptCenter.x - d / 10; pLinePoints[vblCounter - 3].y = ptCenter.y; pLinePoints[vblCounter - 3].style = 18; pLinePoints[vblCounter - 2].x = ptCenter.x; pLinePoints[vblCounter - 2].y = ptCenter.y - d / 10; pLinePoints[vblCounter - 2].style = 18; pLinePoints[vblCounter - 1].x = ptCenter.x + d / 10; pLinePoints[vblCounter - 1].y = ptCenter.y; pLinePoints[vblCounter - 1].style = 5; break; default: break; } return; } catch (exc) { if (Clazz.instanceOf(exc)) { armyc2.c2sd.renderer.utilities.ErrorLogger.LogException(armyc2.c2sd.JavaLineArray.arraysupport._className, "AreaWithCenterFeatureDouble", new armyc2.c2sd.renderer.utilities.RendererException("AreaWithCenterFeatureDouble " + Integer.toString(lineType), exc)); } else { throw exc; } } }, GetATWallPointsDouble: function (pLinePoints, lineType, vblSaveCounter) { var nCounter = 0; try { var j = 0; var k = 0; var lCount = 0; var dLengthSegment = 0; var dIncrement = 0; var pSpikePoints = null; var pt0; var dRemainder = 0; var dSpikeSize = 0; var limit = 0; var crossPt1; var crossPt2; lCount = armyc2.c2sd.JavaLineArray.countsupport.GetFORTLCountDouble(pLinePoints, lineType, vblSaveCounter); pSpikePoints = new Array(lCount); switch (lineType) { case 31131200: case 31131300: pSpikePoints[nCounter] = pLinePoints[0]; pSpikePoints[nCounter].style = 0; nCounter++; break; default: break; } for (j = 0; j < vblSaveCounter - 1; j++) { dLengthSegment = armyc2.c2sd.JavaLineArray.lineutility.CalcDistanceDouble(pLinePoints[j], pLinePoints[j + 1]); switch (lineType) { case 31131100: case 31131000: case 31131200: case 31131300: dIncrement = 60; dSpikeSize = 20; dRemainder = dLengthSegment / dIncrement - (Math.floor((dLengthSegment / dIncrement))); if (dRemainder < 0.75) { limit = Math.floor((dLengthSegment / dIncrement)); } else { limit = Math.floor((dLengthSegment / dIncrement)) + 1; } break; default: dIncrement = 20; dSpikeSize = 10; limit = Math.floor((dLengthSegment / dIncrement)) - 1; break; } if (limit < 1) { pSpikePoints[nCounter] = pLinePoints[j]; nCounter++; pSpikePoints[nCounter] = pLinePoints[j + 1]; nCounter++; continue; } for (k = 0; k < limit; k++) { switch (lineType) { case 31131200: if (k > 0) { pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j + 1], pLinePoints[j], -k * dIncrement + 45, 0); nCounter++; pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j + 1], pLinePoints[j], -k * dIncrement + 4, 5); nCounter++; pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j + 1], pLinePoints[j], -k * dIncrement - 1, 20); nCounter++; pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j + 1], pLinePoints[j], -k * dIncrement - 7, 0); } else { pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j + 1], pLinePoints[j], -k * dIncrement - 45, 0); } break; case 31131300: if (k > 0) { pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j + 1], pLinePoints[j], -k * dIncrement + 45, 0); nCounter++; pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j + 1], pLinePoints[j], -k * dIncrement + 10, 5); nCounter++; pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble(pSpikePoints[nCounter - 1], pLinePoints[j + 1], 5, 0); nCounter++; pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble(pSpikePoints[nCounter - 1], pLinePoints[j + 1], 10, 5); nCounter++; // 한랭전선 소멸 cross line 각도 조절 20201211 crossPt1 = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pSpikePoints[nCounter - 2], pSpikePoints[nCounter - 1], pSpikePoints[nCounter - 1], 2, -5, 0); crossPt2 = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pSpikePoints[nCounter - 1], pSpikePoints[nCounter - 2], pSpikePoints[nCounter - 2], 3, -5, 5); // 한랭전선 소멸 cross line 각도 조절 20201211 pSpikePoints[nCounter] = crossPt1; nCounter++; pSpikePoints[nCounter] = crossPt2; nCounter++; pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j + 1], pLinePoints[j], -k * dIncrement - 13, 0); } else { pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j + 1], pLinePoints[j], -k * dIncrement - 45, 0); } break; default: pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j + 1], pLinePoints[j], -k * dIncrement - 30, 0); break; } if (lineType === 31131000) { pSpikePoints[nCounter].style = 0; } nCounter++; pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j + 1], pLinePoints[j], -k * dIncrement - dSpikeSize, 0); if (lineType === 31131000 || lineType === 31131200 || lineType === 31131300) { pSpikePoints[nCounter].style = 9; } nCounter++; pt0 = armyc2.c2sd.JavaLineArray.lineutility.ExtendLineDouble(pLinePoints[j], pSpikePoints[nCounter - 1], dSpikeSize / 2); if (pLinePoints[j].x > pLinePoints[j + 1].x) { pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pLinePoints[j], pSpikePoints[nCounter - 1], pt0, 2, dSpikeSize); } if (pLinePoints[j].x < pLinePoints[j + 1].x) { pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pLinePoints[j], pSpikePoints[nCounter - 1], pt0, 3, dSpikeSize); } if (pLinePoints[j].x === pLinePoints[j + 1].x) { pSpikePoints[nCounter] = pt0; if (pLinePoints[j].y < pLinePoints[j + 1].y) { pSpikePoints[nCounter].x = pt0.x - dSpikeSize; } else { pSpikePoints[nCounter].x = pt0.x + dSpikeSize; } } nCounter++; if (lineType === 31131000 || lineType === 31131200 || lineType === 31131300) { pSpikePoints[nCounter - 1].style = 9; } pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j], pSpikePoints[nCounter - 2], dSpikeSize, 0); switch (lineType) { case 31131000: pSpikePoints[nCounter].style = 10; break; case 31131200: case 31131300: pSpikePoints[nCounter].style = 10; nCounter++; pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j], pSpikePoints[nCounter - 3], dSpikeSize, 0); break; default: break; } nCounter++; } pSpikePoints[nCounter] = pLinePoints[j + 1]; pSpikePoints[nCounter].style = 0; nCounter++; } for (j = 0; j < nCounter; j++) { pLinePoints[j] = pSpikePoints[j]; } pLinePoints[nCounter - 1].style = 5; pSpikePoints = null; } catch (exc) { if (Clazz.instanceOf(exc)) { armyc2.c2sd.renderer.utilities.ErrorLogger.LogException(armyc2.c2sd.JavaLineArray.arraysupport._className, "GetATWallPointsDouble", new armyc2.c2sd.renderer.utilities.RendererException("GetATWallPointsDouble " + Integer.toString(lineType), exc)); } else { throw exc; } } return nCounter; }, GetRidgePointsDouble: function (pLinePoints, lineType, vblSaveCounter) { var nCounter = 0; try { var j = 0; var k = 0; var lCount = 0; var dLengthSegment = 0; var dIncrement = 20; var m = new armyc2.c2sd.JavaLineArray.ref(); var pSpikePoints = null; var pt0; var dSpikeSize = 20; var limit = 0; var d = 0; var bolVertical = 0; m.value = Clazz.newArray(1, 0); lCount = armyc2.c2sd.JavaLineArray.countsupport.GetFORTLCountDouble(pLinePoints, lineType, vblSaveCounter); pSpikePoints = new Array(lCount); armyc2.c2sd.JavaLineArray.lineutility.InitializePOINT2Array(pSpikePoints); for (j = 0; j < vblSaveCounter - 1; j++) { bolVertical = armyc2.c2sd.JavaLineArray.lineutility.CalcTrueSlopeDouble(pLinePoints[j], pLinePoints[j + 1], m); dLengthSegment = armyc2.c2sd.JavaLineArray.lineutility.CalcDistanceDouble(pLinePoints[j], pLinePoints[j + 1]); limit = Math.floor((dLengthSegment / dIncrement)); if (limit < 1) { pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j]); nCounter++; pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j + 1]); nCounter++; continue; } for (k = 0; k < limit; k++) { pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j + 1], pLinePoints[j], -k * dIncrement, 0); nCounter++; d = armyc2.c2sd.JavaLineArray.lineutility.CalcDistanceDouble(pLinePoints[j], pSpikePoints[nCounter - 1]); pt0 = armyc2.c2sd.JavaLineArray.lineutility.ExtendLineDouble(pLinePoints[j + 1], pLinePoints[j], -d - dSpikeSize / 2); if (bolVertical!== 0) { if (pLinePoints[j].x < pLinePoints[j + 1].x) { pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pLinePoints[j], pLinePoints[j + 1], pt0, 2, dSpikeSize); } else { pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pLinePoints[j], pLinePoints[j + 1], pt0, 3, dSpikeSize); } } else { if (pLinePoints[j + 1].y < pLinePoints[j].y) { pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pLinePoints[j], pLinePoints[j + 1], pt0, 0, dSpikeSize); } else { pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pLinePoints[j], pLinePoints[j + 1], pt0, 1, dSpikeSize); } } nCounter++; pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.ExtendLine2Double(pLinePoints[j + 1], pLinePoints[j], -d - dSpikeSize, 0); nCounter++; } pSpikePoints[nCounter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j + 1]); nCounter++; } for (j = 0; j < nCounter; j++) { pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pSpikePoints[j]); } for (j = nCounter; j < lCount; j++) { pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pSpikePoints[nCounter - 1]); } pSpikePoints = null; } catch (exc) { if (Clazz.instanceOf(exc)) { armyc2.c2sd.renderer.utilities.ErrorLogger.LogException(armyc2.c2sd.JavaLineArray.arraysupport._className, "GetRidgePointsDouble", new armyc2.c2sd.renderer.utilities.RendererException("GetRidgePointsDouble " + Integer.toString(lineType), exc)); } else { throw exc; } } return nCounter; }, GetSquallDouble: function (pLinePoints, amplitude, quantity, length, numPoints) { var counter = 0; try { var j = 0; var k = 0; var StartSegPt; var EndSegPt; var savePoint1 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); var savePoint2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[numPoints - 1]); var sign = new armyc2.c2sd.JavaLineArray.ref(); var segQty = 0; var totalQty = armyc2.c2sd.JavaLineArray.countsupport.GetSquallQty(pLinePoints, quantity, length, numPoints); var pSquallPts = new Array(totalQty); var pSquallSegPts = null; armyc2.c2sd.JavaLineArray.lineutility.InitializePOINT2Array(pSquallPts); sign.value = Clazz.newArray(1, 0); sign.value[0] = -1; if (totalQty === 0) { return 0; } for (j = 0; j < numPoints - 1; j++) { StartSegPt = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j]); EndSegPt = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j + 1]); segQty = armyc2.c2sd.JavaLineArray.countsupport.GetSquallSegQty(StartSegPt, EndSegPt, quantity, length); if (segQty > 0) { pSquallSegPts = new Array(segQty); armyc2.c2sd.JavaLineArray.lineutility.InitializePOINT2Array(pSquallSegPts); } else { pSquallPts[counter].x = StartSegPt.x; pSquallPts[counter++].y = StartSegPt.y; pSquallPts[counter].x = EndSegPt.x; pSquallPts[counter++].y = EndSegPt.y; continue; } sign.value[0] = -1; armyc2.c2sd.JavaLineArray.lineutility.GetSquallSegment(StartSegPt, EndSegPt, pSquallSegPts, sign, amplitude, quantity, length); for (k = 0; k < segQty; k++) { pSquallPts[counter].x = pSquallSegPts[k].x; pSquallPts[counter].y = pSquallSegPts[k].y; if (k === 0) { pSquallPts[counter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j]); } if (k === segQty - 1) { pSquallPts[counter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j + 1]); } pSquallPts[counter].style = 0; counter++; } } for (j = 0; j < counter; j++) { if (j < totalQty) { pLinePoints[j].x = pSquallPts[j].x; pLinePoints[j].y = pSquallPts[j].y; if (j === 0) { pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(savePoint1); } if (j === counter - 1) { pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(savePoint2); } pLinePoints[j].style = pSquallPts[j].style; } } if (counter === 0) { for (j = 0; j < pLinePoints.length; j++) { if (j === 0) { pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(savePoint1); } else { pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(savePoint2); } } counter = pLinePoints.length; } pSquallPts = null; pSquallSegPts = null; } catch (exc) { if (Clazz.instanceOf(exc)) { armyc2.c2sd.renderer.utilities.ErrorLogger.LogException(armyc2.c2sd.JavaLineArray.arraysupport._className, "GetSquallDouble", new armyc2.c2sd.renderer.utilities.RendererException("GetSquallDouble", exc)); } else { throw exc; } } return counter; }, GetSevereSquall: function (pLinePoints, numPoints) { var l = 0; try { var quantity = 5; var length = 30; var j = 0; var k = 0; var totalQty = armyc2.c2sd.JavaLineArray.countsupport.GetSquallQty(pLinePoints, quantity, length, numPoints) + 2 * numPoints; var squallPts = new Array(totalQty); var pt0 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pt1 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pt2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pt3 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pt4 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pt5 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pt6 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pt7 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pt8 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var segQty = 0; var dist = 0; armyc2.c2sd.JavaLineArray.lineutility.InitializePOINT2Array(squallPts); for (j = 0; j < numPoints - 1; j++) { dist = armyc2.c2sd.JavaLineArray.lineutility.CalcDistanceDouble(pLinePoints[j], pLinePoints[j + 1]); segQty = Math.floor((dist / 30)); for (k = 0; k < segQty; k++) { pt0 = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble(pLinePoints[j], pLinePoints[j + 1], k * 30); pt1 = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble(pLinePoints[j], pLinePoints[j + 1], k * 30 + 20); pt5 = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble(pLinePoints[j], pLinePoints[j + 1], k * 30 + 25); pt6 = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble(pLinePoints[j], pLinePoints[j + 1], k * 30 + 30); pt2 = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pt0, pt1, pt1, 2, 5, 0); pt3 = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pt0, pt5, pt5, 3, 5, 0); pt4 = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pt0, pt6, pt6, 2, 5, 5); pt4.style = 5; squallPts[l++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt2); squallPts[l++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt3); squallPts[l++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt4); pt7 = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble(pLinePoints[j], pLinePoints[j + 1], k * 30 + 5); pt8 = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble(pLinePoints[j], pLinePoints[j + 1], k * 30 + 10); pt8.style = 5; squallPts[l++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt7); squallPts[l++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt8); } squallPts[l++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j + 1]); pt0 = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble(pLinePoints[j + 1], pLinePoints[j], 5); pt0.style = 5; squallPts[l++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt0); } for (j = 0; j < l; j++) { if (j < totalQty) { pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(squallPts[j]); } } } catch (exc) { if (Clazz.instanceOf(exc)) { armyc2.c2sd.renderer.utilities.ErrorLogger.LogException(armyc2.c2sd.JavaLineArray.arraysupport._className, "GetSevereSquall", new armyc2.c2sd.renderer.utilities.RendererException("GetSevereSquall", exc)); } else { throw exc; } } return l; }, GetConvergancePointsDouble: function (pLinePoints, vblCounter) { var counter = vblCounter; try { var j = 0; var k = 0; var d = 0; var pt0 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pt1 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var tempPts = new Array(vblCounter); var tempPt = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var numJags = 0; for (j = 0; j < vblCounter; j++) { tempPts[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j]); } pLinePoints[vblCounter - 1].style = 5; for (j = 0; j < vblCounter - 1; j++) { pt0 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(tempPts[j]); pt1 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(tempPts[j + 1]); d = armyc2.c2sd.JavaLineArray.lineutility.CalcDistanceDouble(pt0, pt1); numJags = Math.floor((d / 10)); if (d - numJags * 10 < 5) { numJags -= 1; } for (k = 0; k < numJags; k++) { tempPt = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble(pt0, pt1, k * 10 + 5, 0); pLinePoints[counter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(tempPt); tempPt = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble(tempPt, pt1, 5); tempPt = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pt0, tempPt, tempPt, 2, 5, 5); pLinePoints[counter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(tempPt); tempPt = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble(pt0, pt1, (k + 1) * 10, 0); pLinePoints[counter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(tempPt); tempPt = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble(tempPt, pt1, 5); tempPt = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pt0, tempPt, tempPt, 3, 5, 5); pLinePoints[counter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(tempPt); } } } catch (exc) { if (Clazz.instanceOf(exc)) { armyc2.c2sd.renderer.utilities.ErrorLogger.LogException(armyc2.c2sd.JavaLineArray.arraysupport._className, "GetConvergancePointsDouble", new armyc2.c2sd.renderer.utilities.RendererException("GetConvergancePointsDouble", exc)); } else { throw exc; } } return counter; }, GetITDPointsDouble: function (pLinePoints, vblCounter) { var counter = 0; try { var j = 0; var k = 0; var d = 0; var pt0 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pt1 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var tempPts = new Array(vblCounter); var tempPt = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var numJags = 0; var lineStyle = 19; for (j = 0; j < vblCounter; j++) { tempPts[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j]); } for (j = 0; j < vblCounter - 1; j++) { pt0 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(tempPts[j]); pt1 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(tempPts[j + 1]); d = armyc2.c2sd.JavaLineArray.lineutility.CalcDistanceDouble(pt0, pt1); numJags = Math.floor((d / 15)); if (d - numJags * 10 < 5) { numJags -= 1; } if (numJags === 0) { pt0.style = 19; pLinePoints[counter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt0); pt1.style = 5; pLinePoints[counter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt1); } for (k = 0; k < numJags; k++) { tempPt = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble(pt0, pt1, k * 15 + 5, lineStyle); pLinePoints[counter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(tempPt); if (k < numJags - 1) { tempPt = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble(tempPt, pt1, 10, 5); } else { tempPt = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(tempPts[j + 1]); tempPt.style = 5; } pLinePoints[counter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(tempPt); if (lineStyle === 19) { lineStyle = 25; } else { lineStyle = 19; } } } } catch (exc) { if (Clazz.instanceOf(exc)) { armyc2.c2sd.renderer.utilities.ErrorLogger.LogException(armyc2.c2sd.JavaLineArray.arraysupport._className, "GetITDPointsDouble", new armyc2.c2sd.renderer.utilities.RendererException("GetITDPointsDouble", exc)); } else { throw exc; } } return counter; }, GetXPoints: function (linetype, pOriginalLinePoints, XPoints, vblCounter) { var xCounter = 0; try { var j = 0; var k = 0; var d = 0; var pt0; var pt1; var pt2; var pt3 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pt4 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pt5 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pt6 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var numThisSegment = 0; var distInterval = 0; for (j = 0; j < vblCounter - 1; j++) { d = armyc2.c2sd.JavaLineArray.lineutility.CalcDistanceDouble(pOriginalLinePoints[j], pOriginalLinePoints[j + 1]); numThisSegment = Math.floor(((d - 20) / 20)); if (linetype === 32153000) numThisSegment = Math.floor(((d - 30) / 30)); distInterval = d / numThisSegment; for (k = 0; k < numThisSegment; k++) { pt0 = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble2(pOriginalLinePoints[j], pOriginalLinePoints[j + 1], distInterval / 2 + distInterval * k); pt1 = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble2(pt0, pOriginalLinePoints[j + 1], 5); pt2 = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble2(pt0, pOriginalLinePoints[j + 1], -5); pt3 = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pOriginalLinePoints[j], pt1, pt1, 2, 5); pt4 = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pOriginalLinePoints[j], pt1, pt1, 3, 5); pt4.style = 5; pt5 = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pOriginalLinePoints[j], pt2, pt2, 2, 5); pt6 = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pOriginalLinePoints[j], pt2, pt2, 3, 5); pt6.style = 5; XPoints[xCounter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt3); XPoints[xCounter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt6); XPoints[xCounter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt5); XPoints[xCounter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt4); } } } catch (exc) { if (Clazz.instanceOf(exc)) { armyc2.c2sd.renderer.utilities.ErrorLogger.LogException(armyc2.c2sd.JavaLineArray.arraysupport._className, "GetXPointsDouble", new armyc2.c2sd.renderer.utilities.RendererException("GetXPointsDouble", exc)); } else { throw exc; } } return xCounter; }, getEllipsePoints: function (ptCenter, ptWidth, ptHeight) { var pEllipsePoints = null; try { pEllipsePoints = new Array(37); var l = 0; var dFactor = 0; var a = armyc2.c2sd.JavaLineArray.lineutility.CalcDistanceDouble(ptCenter, ptWidth); var b = armyc2.c2sd.JavaLineArray.lineutility.CalcDistanceDouble(ptCenter, ptHeight); armyc2.c2sd.JavaLineArray.lineutility.InitializePOINT2Array(pEllipsePoints); for (l = 1; l < 37; l++) { dFactor = (10.0 * l) * 3.141592653589793 / 180.0; pEllipsePoints[l - 1].x = ptCenter.x + Math.floor((a * Math.cos(dFactor))); pEllipsePoints[l - 1].y = ptCenter.y + Math.floor((b * Math.sin(dFactor))); pEllipsePoints[l - 1].style = 0; } pEllipsePoints[36] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pEllipsePoints[0]); } catch (exc) { if (Clazz.instanceOf(exc)) { armyc2.c2sd.renderer.utilities.ErrorLogger.LogException(armyc2.c2sd.JavaLineArray.arraysupport._className, "GetXPointsDouble", new armyc2.c2sd.renderer.utilities.RendererException("GetEllipsePoints", exc)); } else { throw exc; } } return pEllipsePoints; }, getRotatedEllipsePoints: function (ptCenter, ptWidth, ptHeight, azimuth, lineType, converter) { var pResultPoints = null; try { var pEllipsePoints = new Array(36); var l = 0, j = 0; var dFactor = 0; var x=0,y=0; var a = armyc2.c2sd.JavaLineArray.lineutility.CalcDistanceDouble(ptCenter, ptWidth); var b = armyc2.c2sd.JavaLineArray.lineutility.CalcDistanceDouble(ptCenter, ptHeight); var ratio=b/a; var ptCenter2d=null; if(converter) { ptCenter2d=new armyc2.c2sd.graphics2d.Point2D(ptCenter.x,ptCenter.y); ptCenter2d=converter.PixelsToGeo(ptCenter2d); var ptWidth2d=new armyc2.c2sd.graphics2d.Point2D(ptWidth.x,ptWidth.y); ptWidth2d=converter.PixelsToGeo(ptWidth2d); var ptHeight2d=new armyc2.c2sd.graphics2d.Point2D(ptHeight.x,ptHeight.y); ptHeight2d=converter.PixelsToGeo(ptHeight2d); a = armyc2.c2sd.JavaTacticalRenderer.mdlGeodesic.geodesic_distance(ptCenter2d, ptWidth2d,null,null); b = armyc2.c2sd.JavaTacticalRenderer.mdlGeodesic.geodesic_distance(ptCenter2d, ptHeight2d, null, null); ptCenter.x=ptCenter2d.x; ptCenter.y=ptCenter2d.y; } var ptTemp2d=new armyc2.c2sd.graphics2d.Point2D(); var ptTemp=null,dAzimuth=0,d=0; var a12 = new armyc2.c2sd.JavaLineArray.ref(); var a21 = new armyc2.c2sd.JavaLineArray.ref(); armyc2.c2sd.JavaLineArray.lineutility.InitializePOINT2Array(pEllipsePoints); for (l = 1; l < 37; l++) { dFactor = (10.0 * l) * Math.PI / 180.0; if(!converter) { pEllipsePoints[l - 1].x = ptCenter.x + (a * Math.cos(dFactor)); pEllipsePoints[l - 1].y = ptCenter.y + (b * Math.sin(dFactor)); pEllipsePoints[l - 1].style = 0; } else //use converter { //POINT2 ptCenter x,y is in geo //dFactor = (10.0 * l) * Math.PI / 180.0; dFactor = -(10.0 * l) * Math.PI / 180.0 + Math.PI / 2; dAzimuth = 10.0 * l; if (lineType === 13000002) //circle { d=Math.sqrt( Math.pow(a*Math.cos(dFactor),2) + Math.pow(b*Math.sin(dFactor),2) ); ptTemp = armyc2.c2sd.JavaTacticalRenderer.mdlGeodesic.geodesic_coordinate(ptCenter, d, dAzimuth); d=armyc2.c2sd.JavaTacticalRenderer.mdlGeodesic.geodesic_distance(ptCenter,ptTemp,a12,a21); ptTemp = armyc2.c2sd.JavaTacticalRenderer.mdlGeodesic.geodesic_coordinate(ptCenter, d, a12.value[0]); } else { b=a*ratio; ptTemp = armyc2.c2sd.JavaTacticalRenderer.mdlGeodesic.geodesic_coordinate(ptCenter, a*Math.cos(dFactor), 90); ptTemp = armyc2.c2sd.JavaTacticalRenderer.mdlGeodesic.geodesic_coordinate(ptTemp, b*Math.sin(dFactor), 0); d=armyc2.c2sd.JavaTacticalRenderer.mdlGeodesic.geodesic_distance(ptCenter,ptTemp,a12,a21); ptTemp = armyc2.c2sd.JavaTacticalRenderer.mdlGeodesic.geodesic_coordinate(ptCenter, d, a12.value[0]); } ptTemp2d.x=ptTemp.x; ptTemp2d.y=ptTemp.y; ptTemp2d=converter.GeoToPixels(ptTemp2d); pEllipsePoints[l - 1]=new armyc2.c2sd.JavaLineArray.POINT2(ptTemp2d.x,ptTemp2d.y); } } if (lineType!== 13000002) { armyc2.c2sd.JavaLineArray.lineutility.RotateGeometryDouble(pEllipsePoints, 36, azimuth - 90, converter, ptCenter); } pResultPoints = new Array(37); for (j = 0; j < 36; j++) pResultPoints[j] = pEllipsePoints[j]; pResultPoints[36] = pEllipsePoints[0]; } catch (exc) { if (Clazz.instanceOf(exc)) { armyc2.c2sd.renderer.utilities.ErrorLogger.LogException(armyc2.c2sd.JavaLineArray.arraysupport._className, "GetXPointsDouble", new armyc2.c2sd.renderer.utilities.RendererException("GetRotatedEllipsePoints", exc)); } else { throw exc; } } return pResultPoints; }, GetLVOPoints: function (linetype, pOriginalLinePoints, pLinePoints, vblCounter) { var lEllipseCounter = 0; try { var dAngle = 0; var d = 0; var a = 4; var b = 8; var dFactor = 0; var lHowManyThisSegment = 0; var j = 0; var k = 0; var l = 0; var t = 0; var ptCenter = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pEllipsePoints2 = new Array(37); var distInterval = 0; for (j = 0; j < vblCounter - 1; j++) { armyc2.c2sd.JavaLineArray.lineutility.InitializePOINT2Array(pEllipsePoints2); d = armyc2.c2sd.JavaLineArray.lineutility.CalcDistanceDouble(pOriginalLinePoints[j], pOriginalLinePoints[j + 1]); lHowManyThisSegment = Math.floor(((d - 20) / 20)); if (linetype === 32153000) lHowManyThisSegment = Math.floor(((d - 30) / 30)); distInterval = d / lHowManyThisSegment; dAngle = armyc2.c2sd.JavaLineArray.lineutility.CalcSegmentAngleDouble(pOriginalLinePoints[j], pOriginalLinePoints[j + 1]); dAngle = dAngle + 1.5707963267948966; for (k = 0; k < lHowManyThisSegment; k++) { ptCenter = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble2(pOriginalLinePoints[j], pOriginalLinePoints[j + 1], k * distInterval); for (l = 1; l < 37; l++) { dFactor = (20.0 * l) * 3.141592653589793 / 180.0; pEllipsePoints2[l - 1].x = ptCenter.x + Math.floor((a * Math.cos(dFactor))); pEllipsePoints2[l - 1].y = ptCenter.y + Math.floor((b * Math.sin(dFactor))); pEllipsePoints2[l - 1].style = 0; } armyc2.c2sd.JavaLineArray.lineutility.RotateGeometryDouble(pEllipsePoints2, 36, Math.floor((dAngle * 180 / 3.141592653589793))); pEllipsePoints2[36] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pEllipsePoints2[35]); pEllipsePoints2[36].style = 5; for (l = 0; l < 37; l++) { pLinePoints[lEllipseCounter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pEllipsePoints2[l]); lEllipseCounter++; } } if (j === vblCounter - 2) { ptCenter = pOriginalLinePoints[j + 1]; for (l = 1; l < 37; l++) { dFactor = (20.0 * l) * 3.141592653589793 / 180.0; pEllipsePoints2[l - 1].x = ptCenter.x + Math.floor((a * Math.cos(dFactor))); pEllipsePoints2[l - 1].y = ptCenter.y + Math.floor((b * Math.sin(dFactor))); pEllipsePoints2[l - 1].style = 0; } armyc2.c2sd.JavaLineArray.lineutility.RotateGeometryDouble(pEllipsePoints2, 36, Math.floor((dAngle * 180 / 3.141592653589793))); pEllipsePoints2[36] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pEllipsePoints2[35]); pEllipsePoints2[36].style = 5; for (l = 0; l < 37; l++) { pLinePoints[lEllipseCounter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pEllipsePoints2[l]); lEllipseCounter++; } } } } catch (exc) { if (Clazz.instanceOf(exc)) { armyc2.c2sd.renderer.utilities.ErrorLogger.LogException(armyc2.c2sd.JavaLineArray.arraysupport._className, "GetLVOPointsDouble", new armyc2.c2sd.renderer.utilities.RendererException("GetLVOPointsDouble", exc)); } else { throw exc; } } return lEllipseCounter; }, GetIcingPointsDouble: function (pLinePoints, vblCounter) { var counter = 0; try { var j = 0; var origPoints = new Array(vblCounter); var nDirection = -1; var k = 0; var numSegments = 0; var pt0 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pt1 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var midPt = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pt2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); for (j = 0; j < vblCounter; j++) { origPoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j]); } var distInterval = 0; for (j = 0; j < vblCounter - 1; j++) { numSegments = Math.floor(armyc2.c2sd.JavaLineArray.lineutility.CalcDistanceDouble(origPoints[j], origPoints[j + 1])); numSegments /= 15; distInterval = armyc2.c2sd.JavaLineArray.lineutility.CalcDistanceDouble(origPoints[j], origPoints[j + 1]) / numSegments; nDirection = armyc2.c2sd.JavaLineArray.arraysupport.GetInsideOutsideDouble2(origPoints[j], origPoints[j + 1], origPoints, vblCounter, j, 31740000); for (k = 0; k < numSegments; k++) { if (k === 0) { pt0 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(origPoints[j]); } else { pt0 = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble(origPoints[j], origPoints[j + 1], k * distInterval, 0); } pt1 = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble(origPoints[j], origPoints[j + 1], k * distInterval + 10, 5); midPt = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble(origPoints[j], origPoints[j + 1], k * distInterval + 5, 0); pt2 = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(origPoints[j], origPoints[j + 1], midPt, nDirection, 5, 5); pLinePoints[counter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt0); pLinePoints[counter + 1] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt1); pLinePoints[counter + 2] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(midPt); pLinePoints[counter + 3] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt2); counter += 4; } } } catch (exc) { if (Clazz.instanceOf(exc)) { armyc2.c2sd.renderer.utilities.ErrorLogger.LogException(armyc2.c2sd.JavaLineArray.arraysupport._className, "GetIcingPointsDouble", new armyc2.c2sd.renderer.utilities.RendererException("GetIcingPointsDouble", exc)); } else { throw exc; } } return counter; }, GetAnchorageDouble: function (vbPoints2, numPts) { var lFlotCounter = 0; try { var j = 0; var k = 0; var l = 0; var x1 = 0; var y1 = 0; var numSegPts = -1; var lFlotCount = 0; var lNumSegs = 0; var dDistance = 0; var vbPoints = null; var points = null; var points2 = null; var pt = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pt1 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pt2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); lFlotCount = armyc2.c2sd.JavaLineArray.flot.GetAnchorageCountDouble(vbPoints2, numPts); vbPoints = Clazz.newArray(2 * numPts, 0); for (j = 0; j < numPts; j++) { vbPoints[k] = Math.floor(vbPoints2[j].x); k++; vbPoints[k] = Math.floor(vbPoints2[j].y); k++; } k = 0; var bFlip = new armyc2.c2sd.JavaLineArray.ref(); bFlip.value = Clazz.newArray(1, 0); var lDirection = new armyc2.c2sd.JavaLineArray.ref(); lDirection.value = Clazz.newArray(1, 0); var lLastDirection = new armyc2.c2sd.JavaLineArray.ref(); lLastDirection.value = Clazz.newArray(1, 0); for (l = 0; l < numPts - 1; l++) { pt1.x = vbPoints[2 * l]; pt1.y = vbPoints[2 * l + 1]; pt2.x = vbPoints[2 * l + 2]; pt2.y = vbPoints[2 * l + 3]; if (l > 0) { pt1 = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble(pt1, pt2, 20); } dDistance = armyc2.c2sd.JavaLineArray.lineutility.CalcDistanceDouble(pt1, pt2); lNumSegs = Math.floor((dDistance / 20)); if (lNumSegs > 0) { points2 = Clazz.newArray(lNumSegs * 32, 0); numSegPts = armyc2.c2sd.JavaLineArray.flot.GetAnchorageFlotSegment(vbPoints, Math.floor(pt1.x), Math.floor(pt1.y), Math.floor(pt2.x), Math.floor(pt2.y), l, points2, bFlip, lDirection, lLastDirection); points = Clazz.newArray(numSegPts, 0); for (j = 0; j < numSegPts; j++) { points[j] = points2[j]; } for (j = 0; j < Math.floor(numSegPts / 3); j++) { x1 = points[k]; y1 = points[k + 1]; k += 3; if (j % 10 === 0) { pt.x = x1; pt.y = y1; pt.style = 5; } else if ((j + 1) % 10 === 0) { if (lFlotCounter < lFlotCount) { vbPoints2[lFlotCounter].x = x1; vbPoints2[lFlotCounter++].y = y1; vbPoints2[lFlotCounter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt); continue; } else { break; } } if (lFlotCounter < lFlotCount) { vbPoints2[lFlotCounter].x = x1; vbPoints2[lFlotCounter].y = y1; lFlotCounter++; } else { break; } } k = 0; points = null; } else { if (lFlotCounter < lFlotCount) { vbPoints2[lFlotCounter].x = vbPoints[2 * l]; vbPoints2[lFlotCounter].y = vbPoints[2 * l + 1]; lFlotCounter++; } } } for (j = lFlotCounter - 1; j < lFlotCount; j++) { vbPoints2[j].style = 5; } vbPoints = null; points = null; points2 = null; } catch (exc) { if (Clazz.instanceOf(exc)) { armyc2.c2sd.renderer.utilities.ErrorLogger.LogException(armyc2.c2sd.JavaLineArray.arraysupport._className, "GetAnchorageDouble", new armyc2.c2sd.renderer.utilities.RendererException("GetAnchorageDouble", exc)); } else { throw exc; } } return lFlotCounter; }, GetPipePoints: function (pLinePoints, vblCounter) { var counter = 0; try { var pOriginalPoints = new Array(vblCounter); var pt0 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pt1 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pt2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var xPoints = new Array(pLinePoints.length); var xCounter = 0; var j = 0; var k = 0; for (j = 0; j < vblCounter; j++) { pOriginalPoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j]); } var numSegs = 0; var d = 0; armyc2.c2sd.JavaLineArray.lineutility.InitializePOINT2Array(xPoints); for (j = 0; j < vblCounter - 1; j++) { d = armyc2.c2sd.JavaLineArray.lineutility.CalcDistanceDouble(pOriginalPoints[j], pOriginalPoints[j + 1]); numSegs = Math.floor((d / 20)); for (k = 0; k < numSegs; k++) { pt0 = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble2(pOriginalPoints[j], pOriginalPoints[j + 1], 20 * k); pt0.style = 0; pt1 = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble2(pOriginalPoints[j], pOriginalPoints[j + 1], 20 * k + 10); pt1.style = 5; pt2 = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble2(pOriginalPoints[j], pOriginalPoints[j + 1], 20 * k + 10); pt2.style = 20; pLinePoints[counter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt0); pLinePoints[counter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt1); xPoints[xCounter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt2); } if (numSegs === 0) { pLinePoints[counter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pOriginalPoints[j]); pLinePoints[counter++].style = 0; pLinePoints[counter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pOriginalPoints[j + 1]); pLinePoints[counter++].style = 5; } else { pLinePoints[counter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[counter - 1]); pLinePoints[counter++].style = 0; pLinePoints[counter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pOriginalPoints[j + 1]); pLinePoints[counter++].style = 5; } } for (k = 0; k < xCounter; k++) { pLinePoints[counter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(xPoints[k]); } pLinePoints[counter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[counter]); pOriginalPoints = null; xPoints = null; } catch (exc) { if (Clazz.instanceOf(exc)) { armyc2.c2sd.renderer.utilities.ErrorLogger.LogException(armyc2.c2sd.JavaLineArray.arraysupport._className, "GetPipePoints", new armyc2.c2sd.renderer.utilities.RendererException("GetPipePoints", exc)); } else { throw exc; } } return counter; }, GetReefPoints: function (pLinePoints, vblCounter) { var counter = 0; try { var pOriginalPoints = new Array(vblCounter); var pt0 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pt1 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pt2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pt3 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pt4 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); for (var j = 0; j < vblCounter; j++) { pOriginalPoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j]); } var numSegs = 0; var direction = 0; var d = 0; for (var j = 0; j < vblCounter - 1; j++) { if (pOriginalPoints[j].x < pOriginalPoints[j + 1].x) direction = 2; else direction = 3; d = armyc2.c2sd.JavaLineArray.lineutility.CalcDistanceDouble(pOriginalPoints[j], pOriginalPoints[j + 1]); numSegs = Math.floor((d / 40)); for (var k = 0; k < numSegs; k++) { pt0 = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble2(pOriginalPoints[j], pOriginalPoints[j + 1], 40 * k); pt1 = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble2(pt0, pOriginalPoints[j + 1], 10); pt1 = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pOriginalPoints[j], pOriginalPoints[j + 1], pt1, direction, 15); pt2 = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble2(pt0, pOriginalPoints[j + 1], 20); pt2 = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pOriginalPoints[j], pOriginalPoints[j + 1], pt2, direction, 5); pt3 = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble2(pt0, pOriginalPoints[j + 1], 30); pt3 = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pOriginalPoints[j], pOriginalPoints[j + 1], pt3, direction, 20); pt4 = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble2(pOriginalPoints[j], pOriginalPoints[j + 1], 40 * (k + 1)); pLinePoints[counter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt0); pLinePoints[counter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt1); pLinePoints[counter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt2); pLinePoints[counter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt3); pLinePoints[counter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt4); } if (numSegs === 0) { pLinePoints[counter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pOriginalPoints[j]); pLinePoints[counter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pOriginalPoints[j + 1]); } } pLinePoints[counter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pOriginalPoints[vblCounter - 1]); pOriginalPoints = null; } catch (exc) { if (Clazz.instanceOf(exc)) { armyc2.c2sd.renderer.utilities.ErrorLogger.LogException(armyc2.c2sd.JavaLineArray.arraysupport._className, "GetReefPoints", new armyc2.c2sd.renderer.utilities.RendererException("GetReefPoints", exc)); } else { throw exc; } } return counter; }, GetRestrictedAreaPoints: function (pLinePoints, vblCounter) { var counter = 0; try { var pOriginalPoints = new Array(vblCounter); var pt0 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pt1 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pt2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var pt3 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); for (var j = 0; j < vblCounter; j++) { pOriginalPoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j]); } var direction = 0; var numSegs = 0; var d = 0; for (var j = 0; j < vblCounter - 1; j++) { d = armyc2.c2sd.JavaLineArray.lineutility.CalcDistanceDouble(pOriginalPoints[j], pOriginalPoints[j + 1]); numSegs = Math.floor((d / 15)); if (pOriginalPoints[j].x < pOriginalPoints[j + 1].x) direction = 3; else direction = 2; for (var k = 0; k < numSegs; k++) { pt0 = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble2(pOriginalPoints[j], pOriginalPoints[j + 1], 15 * k); pt0.style = 0; pt1 = armyc2.c2sd.JavaLineArray.lineutility.ExtendAlongLineDouble2(pOriginalPoints[j], pOriginalPoints[j + 1], 15 * k + 10); pt1.style = 5; pt2 = armyc2.c2sd.JavaLineArray.lineutility.MidPointDouble(pt0, pt1, 0); pt3 = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pOriginalPoints[j], pOriginalPoints[j + 1], pt2, direction, 10); pt3.style = 5; pLinePoints[counter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt2); pLinePoints[counter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt3); pLinePoints[counter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt0); pLinePoints[counter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt1); } if (numSegs === 0) { pLinePoints[counter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pOriginalPoints[j]); pLinePoints[counter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pOriginalPoints[j + 1]); } } pLinePoints[counter - 1].style = 0; pLinePoints[counter++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pOriginalPoints[vblCounter - 1]); pOriginalPoints = null; } catch (exc) { if (Clazz.instanceOf(exc)) { armyc2.c2sd.renderer.utilities.ErrorLogger.LogException(armyc2.c2sd.JavaLineArray.arraysupport._className, "GetRestrictedAreaPoints", new armyc2.c2sd.renderer.utilities.RendererException("GetRestrictedAreaPoints", exc)); } else { throw exc; } } return counter; }, getOverheadWire: function (pLinePoints, vblCounter) { var counter = 0; try { var j = 0; var pt = null; var pt2 = null; var x = 0; var y = 0; var pts = new java.util.ArrayList(); for (j = 0; j < vblCounter; j++) { pt = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j]); x = pt.x; y = pt.y; pt2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt); pt2.y -= 5; pts.add(pt2); pt2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt); pt2.x -= 5; pts.add(pt2); pt2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt); pt2.y -= 20; pts.add(pt2); pt2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt); pt2.x += 5; pts.add(pt2); pt2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt); pt2.y -= 5; pt2.style = 5; pts.add(pt2); pt2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt); pt2.x -= 2; pt2.y -= 10; pts.add(pt2); pt2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt); pt2.x += 2; pt2.y -= 10; pt2.style = 5; pts.add(pt2); pt2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt); pt2.x -= 7; pt2.y -= 17; pts.add(pt2); pt2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt); pt2.x -= 5; pt2.y -= 20; pts.add(pt2); pt2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt); pt2.x += 5; pt2.y -= 20; pts.add(pt2); pt2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt); pt2.x += 7; pt2.y -= 17; pt2.style = 5; pts.add(pt2); pt2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt); pt2.y -= 20; pts.add(pt2); pt2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt); pt2.x += 8; pt2.y -= 12; pt2.style = 5; pts.add(pt2); } for (j = 0; j < vblCounter - 1; j++) { pt = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j]); pt2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j + 1]); if (pt.x < pt2.x) { pt.x += 5; pt.y -= 10; pt2.x -= 5; pt2.y -= 10; pt2.style = 5; } else { pt.x -= 5; pt.y -= 10; pt2.x += 5; pt2.y -= 10; pt2.style = 5; } pts.add(pt); pts.add(pt2); } for (j = 0; j < pts.size(); j++) { pLinePoints[j] = pts.get(j); counter++; } for (j = counter; j < pLinePoints.length; j++) pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[counter - 1]); } catch (exc) { if (Clazz.instanceOf(exc)) { armyc2.c2sd.renderer.utilities.ErrorLogger.LogException(armyc2.c2sd.JavaLineArray.arraysupport._className, "GetOverheadWire", new armyc2.c2sd.renderer.utilities.RendererException("GetOverheadWire", exc)); } else { throw exc; } } return counter; }, GetLineArray2Double: function (lineType, pLinePoints, vblCounter, vblSaveCounter, shapes, clipBounds, rev, converter) { var points = new java.util.ArrayList(); try { var client = armyc2.c2sd.JavaLineArray.CELineArray.getClient(); if (pLinePoints === null || pLinePoints.length < 2) return null; var segments = null; var dMRR = 0; var n = 0; var bolVertical = 0; var dExtendLength = 0; var dWidth = 0; var nQuadrant = 0; var lLinestyle = 0; var pointCounter = 0; var offsetX = new armyc2.c2sd.JavaLineArray.ref(); var offsetY = new armyc2.c2sd.JavaLineArray.ref(); var b = 0; var b1 = 0; var dRadius = 0; var d1 = 0; var d = 0; var d2 = 0; var m = new armyc2.c2sd.JavaLineArray.ref(); var direction = 0; var nCounter = 0; var j = 0; var k = 0; var middleSegment = -1; var dMBR = armyc2.c2sd.JavaLineArray.lineutility.MBRDistance(pLinePoints, vblSaveCounter); var pt0 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); var pt1 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[1]); var pt2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[1]); var pt3 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); var pt4 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); var pt5 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); var pt6 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); var pt7 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); var pt8 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); var ptYIntercept = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); var ptYIntercept1 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); var ptCenter = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); var pArrowPoints = new Array(3); var arcPts = new Array(26); var circlePoints = new Array(100); var pts = null; var pts2 = null; var midpt = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); var midpt1 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); var pOriginalLinePoints = null; var pUpperLinePoints = null; var pLowerLinePoints = null; var pUpperLowerLinePoints = null; var calcPoint0 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var calcPoint1 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var calcPoint2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var calcPoint3 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var calcPoint4 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(); var ptTemp = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); var acCounter = 0; var acPoints = new Array(6); var lFlotCount = 0; if (vblCounter > 2) pt2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[2]); pt0.style = 0; pt1.style = 0; pt2.style = 0; var xPoints = null; pOriginalLinePoints = new Array(vblSaveCounter); for (j = 0; j < vblSaveCounter; j++) { pOriginalLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j]); } switch (lineType) { case 15000001: armyc2.c2sd.JavaLineArray.lineutility.getExteriorPoints(pLinePoints, vblSaveCounter, lineType, false); acCounter = vblSaveCounter; break; case 12000000: pt0 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); pLinePoints[0] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt0); pLinePoints[0].x -= 10; pLinePoints[1] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt0); pLinePoints[1].x += 10; pLinePoints[1].style = 10; pLinePoints[2] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt0); pLinePoints[2].y += 10; pLinePoints[3] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt0); pLinePoints[3].y -= 10; acCounter = 4; break; case 14000000: // pt0 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); // pt2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[1]); // pt1 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt0); // pt1.y = pt2.y; // pt3 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt2); // pt3.y = pt0.y; armyc2.c2sd.JavaLineArray.lineutility.CalcMBRPoints(pLinePoints, pLinePoints.length, pt0, pt2); //pt0=ul, pt1=lr pt1 = new armyc2.c2sd.JavaLineArray.POINT2(pt0); pt1.x = pt2.x; pt3 = new armyc2.c2sd.JavaLineArray.POINT2(pt0); pt3.y = pt2.y; pLinePoints = new Array(5); pLinePoints[0] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt0); pLinePoints[1] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt1); pLinePoints[2] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt2); pLinePoints[3] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt3); pLinePoints[4] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt0); acCounter = 5; break; case 15000003: pOriginalLinePoints = new Array(5); pOriginalLinePoints[0] = new armyc2.c2sd.JavaLineArray.POINT2(pLinePoints[0]); pOriginalLinePoints[1] = new armyc2.c2sd.JavaLineArray.POINT2(pLinePoints[1]); pOriginalLinePoints[2] = new armyc2.c2sd.JavaLineArray.POINT2(pLinePoints[2]); pOriginalLinePoints[3] = new armyc2.c2sd.JavaLineArray.POINT2(pLinePoints[3]); pOriginalLinePoints[4] = new armyc2.c2sd.JavaLineArray.POINT2(pLinePoints[0]); //pt0 will be ul, pt1 will be lr var buffer = pLinePoints[0].style; // armyc2.c2sd.JavaLineArray.lineutility.CalcMBRPoints(pLinePoints, pLinePoints.length, pt0, pt1); // xmin=pt0.x; // ymin=pt0.y; // xmax=pt1.x; // ymax=pt1.y; // //end section // // pt0 = new armyc2.c2sd.JavaLineArray.POINT2(xmin - buffer, ymin - buffer); // pt2 = new armyc2.c2sd.JavaLineArray.POINT2(xmax + buffer, ymax + buffer); // pt1 = new armyc2.c2sd.JavaLineArray.POINT2(pt0); // pt1.y = pt2.y; // pt3 = new armyc2.c2sd.JavaLineArray.POINT2(pt2); // pt3.y = pt0.y; // pLinePoints=new Array(5); // pLinePoints[0] = new armyc2.c2sd.JavaLineArray.POINT2(pt0); // pLinePoints[1] = new armyc2.c2sd.JavaLineArray.POINT2(pt1); // pLinePoints[2] = new armyc2.c2sd.JavaLineArray.POINT2(pt2); // pLinePoints[3] = new armyc2.c2sd.JavaLineArray.POINT2(pt3); // pLinePoints[4] = new armyc2.c2sd.JavaLineArray.POINT2(pt0); //clockwise orientation pt0 = pLinePoints[0]; pt0.x -= buffer; pt0.y -= buffer; pt1 = pLinePoints[1]; pt1.x += buffer; pt1.y -= buffer; pt2 = pLinePoints[2]; pt2.x += buffer; pt2.y += buffer; pt3 = pLinePoints[3]; pt3.x -= buffer; pt3.y += buffer; pLinePoints = new Array(5); pLinePoints[0] = new armyc2.c2sd.JavaLineArray.POINT2(pt0); pLinePoints[1] = new armyc2.c2sd.JavaLineArray.POINT2(pt1); pLinePoints[2] = new armyc2.c2sd.JavaLineArray.POINT2(pt2); pLinePoints[3] = new armyc2.c2sd.JavaLineArray.POINT2(pt3); pLinePoints[4] = new armyc2.c2sd.JavaLineArray.POINT2(pt0); acCounter = 5; vblSaveCounter = 5; // pOriginalLinePoints=new Array(vblSaveCounter); // pt0 = new armyc2.c2sd.JavaLineArray.POINT2(xmin, ymin); // pt2 = new armyc2.c2sd.JavaLineArray.POINT2(xmax, ymax); // pt1 = new armyc2.c2sd.JavaLineArray.POINT2(pt0); // pt1.y = pt2.y; // pt3 = new armyc2.c2sd.JavaLineArray.POINT2(pt2); // pt3.y = pt0.y; // pOriginalLinePoints[0] = new armyc2.c2sd.JavaLineArray.POINT2(pt0); // pOriginalLinePoints[1] = new armyc2.c2sd.JavaLineArray.POINT2(pt1); // pOriginalLinePoints[2] = new armyc2.c2sd.JavaLineArray.POINT2(pt2); // pOriginalLinePoints[3] = new armyc2.c2sd.JavaLineArray.POINT2(pt3); // pOriginalLinePoints[4] = new armyc2.c2sd.JavaLineArray.POINT2(pt0); break; case 13000000: //not currently used pt0 = pLinePoints[0]; pt1 = pLinePoints[1]; pt2 = pLinePoints[2]; //pLinePoints = armyc2.c2sd.JavaLineArray.arraysupport.getEllipsePoints(pt0, pt1, pt2); var azimuth = pLinePoints[3].x; pLinePoints = armyc2.c2sd.JavaLineArray.arraysupport.getRotatedEllipsePoints(pt0, pt1, pt2, azimuth, lineType, converter); acCounter = 37; break; case 13000001: //not currently used case 13000002: var x0=pLinePoints[0].x; var y0=pLinePoints[0].y; pt0 = pLinePoints[0];//the center of the ellipse pt1 = pLinePoints[1];//the width of the ellipse pt2 = pLinePoints[2];//the height of the ellipse azimuth = pLinePoints[3].x; pOriginalLinePoints = armyc2.c2sd.JavaLineArray.arraysupport.getRotatedEllipsePoints(pt0, pt1, pt2, azimuth, lineType, converter); //use linestyle to get the distance to expand the shape for the buffer shape //pt0.style is either in pixels or meters, depending on whether the converter is being used var dist=pt0.style; if(converter) { //extend semi-major axis for the buffer var pt12d=new armyc2.c2sd.graphics2d.Point2D(pt1.x,pt1.y); pt12d=converter.PixelsToGeo(pt12d); pt1=new armyc2.c2sd.JavaLineArray.POINT2(pt12d.x,pt12d.y); pt1=armyc2.c2sd.JavaTacticalRenderer.mdlGeodesic.geodesic_coordinate(pt1,dist,90); pt12d=new armyc2.c2sd.graphics2d.Point2D(pt1.x,pt1.y); pt12d=converter.GeoToPixels(pt12d); pt1=new armyc2.c2sd.JavaLineArray.POINT2(pt12d.x,pt12d.y); //extend semi-minor axis for the buffer var pt22d=new armyc2.c2sd.graphics2d.Point2D(pt2.x,pt2.y); pt22d=converter.PixelsToGeo(pt22d); pt2=new armyc2.c2sd.JavaLineArray.POINT2(pt22d.x,pt22d.y); pt2=armyc2.c2sd.JavaTacticalRenderer.mdlGeodesic.geodesic_coordinate(pt2,dist,0); pt22d=new armyc2.c2sd.graphics2d.Point2D(pt2.x,pt2.y); pt22d=converter.GeoToPixels(pt22d); pt2=new armyc2.c2sd.JavaLineArray.POINT2(pt22d.x,pt22d.y); } else { pt1.x+=dist; pt2.y-=dist; } //restore original pt0; pt0.x=x0; pt0.y=y0; pLinePoints = armyc2.c2sd.JavaLineArray.arraysupport.getRotatedEllipsePoints(pt0, pt1, pt2, azimuth, lineType, converter); acCounter = 37; vblSaveCounter=37; break; case 23200000: acCounter = armyc2.c2sd.JavaLineArray.arraysupport.getOverheadWire(pLinePoints, vblSaveCounter); break; case 23200001: for (j = 0; j < vblSaveCounter; j++) { pLinePoints[j].style = 1; } for (j = vblSaveCounter; j < 2 * vblSaveCounter; j++) { pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pOriginalLinePoints[j - vblSaveCounter]); pLinePoints[j].style = 20; } acCounter = pLinePoints.length; break; case 22121000: acCounter = pLinePoints.length; break; case 322510000: vblCounter = armyc2.c2sd.JavaLineArray.arraysupport.GetReefPoints(pLinePoints, vblSaveCounter); acCounter = vblCounter; break; case 32134000: armyc2.c2sd.JavaLineArray.lineutility.GetArrowHead4Double(pLinePoints[vblCounter - 5], pLinePoints[vblCounter - 4], 10, 10, pArrowPoints, 0); for (j = 0; j < 3; j++) { pLinePoints[vblCounter - 3 + j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pArrowPoints[j]); } pLinePoints[vblCounter - 4].style = 5; pLinePoints[vblCounter - 1].style = 5; acCounter = vblCounter; break; case 32530000: vblCounter = armyc2.c2sd.JavaLineArray.arraysupport.GetRestrictedAreaPoints(pLinePoints, vblSaveCounter); acCounter = vblCounter; break; case 32550000: //diagnostic dMBR = armyc2.c2sd.JavaLineArray.lineutility.MBRDistance(pLinePoints, vblSaveCounter); d = 20; if (dMBR < 60) d = dMBR / 4; if (d < 5) d = 5; //end section for (j = 0; j < vblSaveCounter; j++) { pLinePoints[j].style = 1; } pLinePoints[vblSaveCounter - 1].style = 5; pt0 = armyc2.c2sd.JavaLineArray.lineutility.CalcCenterPointDouble(pLinePoints, vblSaveCounter - 1); //armyc2.c2sd.JavaLineArray.lineutility.CalcCircleDouble(pt0, 20, 26, arcPts, 0); armyc2.c2sd.JavaLineArray.lineutility.CalcCircleDouble(pt0, d, 26, arcPts, 0); for (j = vblSaveCounter; j < vblSaveCounter + 26; j++) { pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(arcPts[j - vblSaveCounter]); } //diagnostic if (dMBR < 50) { //d was used as the circle radius d *= 0.6; } else d = 12; //end section pLinePoints[j - 1].style = 5; pt1 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt0); pt1.y -= d;//12; pt1.style = 0; pt2 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt1); pt2.y += d;//12; pt2.style = 5; pt3 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt2); pt3.y += d / 4;//3; pt3.style = 0; pt4 = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt3); pt4.y += d / 4;//3; pLinePoints[j++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt1); pLinePoints[j++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt2); pLinePoints[j++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt3); pt4.style = 5; pLinePoints[j++] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt4); vblCounter = j; acCounter = vblCounter; break; case 32680000: vblCounter = armyc2.c2sd.JavaLineArray.arraysupport.GetPipePoints(pLinePoints, vblSaveCounter); acCounter = vblCounter; break; case 32231500: n = armyc2.c2sd.JavaLineArray.arraysupport.GetInsideOutsideDouble2(pLinePoints[0], pLinePoints[1], pLinePoints, vblSaveCounter, 0, lineType); nQuadrant = armyc2.c2sd.JavaLineArray.lineutility.GetQuadrantDouble(pLinePoints[0], pLinePoints[1]); switch (nQuadrant) { case 4: switch (n) { case 1: case 2: break; case 0: case 3: armyc2.c2sd.JavaLineArray.lineutility.ReversePointsDouble2(pLinePoints, vblSaveCounter); break; default: break; } break; case 1: switch (n) { case 1: case 3: break; case 0: case 2: armyc2.c2sd.JavaLineArray.lineutility.ReversePointsDouble2(pLinePoints, vblSaveCounter); break; default: break; } break; case 2: switch (n) { case 1: case 2: armyc2.c2sd.JavaLineArray.lineutility.ReversePointsDouble2(pLinePoints, vblSaveCounter); break; case 0: case 3: break; default: break; } break; case 3: switch (n) { case 1: case 3: armyc2.c2sd.JavaLineArray.lineutility.ReversePointsDouble2(pLinePoints, vblSaveCounter); break; case 0: case 2: break; default: break; } break; default: break; } lFlotCount = armyc2.c2sd.JavaLineArray.arraysupport.GetAnchorageDouble(pLinePoints, vblSaveCounter); acCounter = lFlotCount; break; case 32231400: armyc2.c2sd.JavaLineArray.lineutility.ReversePointsDouble2(pLinePoints, vblSaveCounter); acCounter = armyc2.c2sd.JavaLineArray.arraysupport.GetAnchorageDouble(pLinePoints, vblSaveCounter); break; case 32153000: var xCount = armyc2.c2sd.JavaLineArray.countsupport.GetXPointsCount(lineType, pOriginalLinePoints, vblSaveCounter); var xPoints2 = new Array(xCount); var lvoCount = armyc2.c2sd.JavaLineArray.countsupport.GetLVOCount(lineType, pOriginalLinePoints, vblSaveCounter); var lvoPoints = new Array(lvoCount); xCount = armyc2.c2sd.JavaLineArray.arraysupport.GetXPoints(lineType, pOriginalLinePoints, xPoints2, vblSaveCounter); lvoCount = armyc2.c2sd.JavaLineArray.arraysupport.GetLVOPoints(lineType, pOriginalLinePoints, lvoPoints, vblSaveCounter); for (k = 0; k < xCount; k++) { pLinePoints[k] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(xPoints2[k]); } if (xCount > 0) pLinePoints[xCount - 1].style = 5; for (k = 0; k < lvoCount; k++) { pLinePoints[xCount + k] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(lvoPoints[k]); } acCounter = xCount + lvoCount; break; case 32152000: if (pLinePoints[0].x < pLinePoints[1].x) armyc2.c2sd.JavaLineArray.lineutility.ReversePointsDouble2(pLinePoints, vblSaveCounter); lFlotCount = armyc2.c2sd.JavaLineArray.flot.GetFlotDouble(pLinePoints, vblSaveCounter); acCounter = lFlotCount; break; case 32151000: acCounter = armyc2.c2sd.JavaLineArray.arraysupport.GetLVOPoints(lineType, pOriginalLinePoints, pLinePoints, vblSaveCounter); break; case 31740000: vblCounter = armyc2.c2sd.JavaLineArray.arraysupport.GetIcingPointsDouble(pLinePoints, vblSaveCounter); acCounter = vblCounter; break; case 31720000: n = armyc2.c2sd.JavaLineArray.arraysupport.GetInsideOutsideDouble2(pLinePoints[0], pLinePoints[1], pLinePoints, vblSaveCounter, 0, lineType); nQuadrant = armyc2.c2sd.JavaLineArray.lineutility.GetQuadrantDouble(pLinePoints[0], pLinePoints[1]); switch (nQuadrant) { case 4: switch (n) { case 0: case 3: break; case 1: case 2: armyc2.c2sd.JavaLineArray.lineutility.ReversePointsDouble2(pLinePoints, vblSaveCounter); break; default: break; } break; case 1: switch (n) { case 0: case 2: break; case 1: case 3: armyc2.c2sd.JavaLineArray.lineutility.ReversePointsDouble2(pLinePoints, vblSaveCounter); break; default: break; } break; case 2: switch (n) { case 0: case 3: armyc2.c2sd.JavaLineArray.lineutility.ReversePointsDouble2(pLinePoints, vblSaveCounter); break; case 1: case 2: break; default: break; } break; case 3: switch (n) { case 0: case 2: armyc2.c2sd.JavaLineArray.lineutility.ReversePointsDouble2(pLinePoints, vblSaveCounter); break; case 1: case 3: break; default: break; } break; default: break; } lFlotCount = armyc2.c2sd.JavaLineArray.flot.GetFlotDouble(pLinePoints, vblSaveCounter); acCounter = lFlotCount; break; case 31148000: acCounter = armyc2.c2sd.JavaLineArray.arraysupport.GetITDPointsDouble(pLinePoints, vblSaveCounter); break; case 31147000: acCounter = armyc2.c2sd.JavaLineArray.arraysupport.GetConvergancePointsDouble(pLinePoints, vblSaveCounter); break; case 31142000: vblCounter = armyc2.c2sd.JavaLineArray.arraysupport.GetRidgePointsDouble(pLinePoints, lineType, vblSaveCounter); acCounter = vblCounter; break; case 31141000: case 31144000: case 31145000: vblCounter = armyc2.c2sd.JavaLineArray.arraysupport.GetSquallDouble(pLinePoints, 10, 6, 30, vblSaveCounter); acCounter = vblCounter; break; case 31143000: vblCounter = armyc2.c2sd.JavaLineArray.arraysupport.GetSevereSquall(pLinePoints, vblSaveCounter); acCounter = vblCounter; break; case 31134100: case 31134200: case 31134300: vblCounter = armyc2.c2sd.JavaLineArray.flot.GetSFPointsDouble(pLinePoints, vblSaveCounter, lineType); acCounter = vblCounter; break; case 31134000: vblCounter = armyc2.c2sd.JavaLineArray.flot.GetOccludedPointsDouble(pLinePoints, vblSaveCounter, lineType); for (j = 0; j < vblSaveCounter; j++) pLinePoints[vblCounter + j] = pOriginalLinePoints[j]; vblCounter += vblSaveCounter; acCounter = vblCounter; break; case 31133200: vblCounter = armyc2.c2sd.JavaLineArray.flot.GetOFYPointsDouble(pLinePoints, vblSaveCounter, lineType); acCounter = vblCounter; break; case 31133000: case 31133100: vblCounter = armyc2.c2sd.JavaLineArray.flot.GetOccludedPointsDouble(pLinePoints, vblSaveCounter, lineType); for (j = 0; j < vblSaveCounter; j++) pLinePoints[vblCounter + j] = pOriginalLinePoints[j]; vblCounter += vblSaveCounter; acCounter = vblCounter; break; case 31132000: case 31132100: lFlotCount = armyc2.c2sd.JavaLineArray.flot.GetFlot2Double(pLinePoints, vblSaveCounter, lineType); for (j = 0; j < vblSaveCounter; j++) pLinePoints[vblCounter - vblSaveCounter + j] = pOriginalLinePoints[j]; acCounter = lFlotCount + vblSaveCounter; break; case 31132200: case 31132300: lFlotCount = armyc2.c2sd.JavaLineArray.flot.GetFlot2Double(pLinePoints, vblSaveCounter, lineType); acCounter = lFlotCount; break; case 31131200: case 31131300: vblCounter = armyc2.c2sd.JavaLineArray.arraysupport.GetATWallPointsDouble(pLinePoints, lineType, vblSaveCounter); acCounter = vblCounter; break; case 31131000: case 31131100: vblCounter = armyc2.c2sd.JavaLineArray.arraysupport.GetATWallPointsDouble(pLinePoints, lineType, vblSaveCounter); pLinePoints[vblCounter - 1].style = 5; for (j = 0; j < vblSaveCounter; j++) pLinePoints[vblCounter + j] = pOriginalLinePoints[j]; vblCounter += vblSaveCounter; pLinePoints[vblCounter - 1].style = 5; acCounter = vblCounter; break; case 22524000: case 221312100: case 221312200: case 23191000: case 23192000: case 23193000: armyc2.c2sd.JavaLineArray.lineutility.LineRelativeToLine(pLinePoints[0], pLinePoints[1], pLinePoints[2], pt0, pt1); d = armyc2.c2sd.JavaLineArray.lineutility.CalcDistanceDouble(pLinePoints[0], pt0); pt4 = armyc2.c2sd.JavaLineArray.lineutility.ExtendLineDouble(pt0, pLinePoints[0], d); armyc2.c2sd.JavaLineArray.lineutility.LineRelativeToLine(pLinePoints[0], pLinePoints[1], pt4, pt2, pt3); pLinePoints[0] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt0); pLinePoints[1] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt1); pLinePoints[2] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt3); pLinePoints[3] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt2); switch (lineType) { case 22524000: case 221312100: case 221312200: case 23193000: pLinePoints[0].style = 0; pLinePoints[1].style = 5; pLinePoints[2].style = 0; break; case 23191000: pLinePoints[0].style = 1; pLinePoints[1].style = 5; pLinePoints[2].style = 1; break; case 23192000: pLinePoints[1].style = 5; if (pt0.x <= pt1.x) { if (pLinePoints[1].y <= pLinePoints[2].y) { pLinePoints[0].style = 0; pLinePoints[2].style = 1; } else { pLinePoints[0].style = 1; pLinePoints[2].style = 0; } } else { if (pLinePoints[1].y >= pLinePoints[2].y) { pLinePoints[0].style = 0; pLinePoints[2].style = 1; } else { pLinePoints[0].style = 1; pLinePoints[2].style = 0; } } break; default: break; } acCounter = 4; break; case 23224000: armyc2.c2sd.JavaLineArray.lineutility.LineRelativeToLine(pLinePoints[0], pLinePoints[1], pLinePoints[2], pt0, pt1); pLinePoints[0].style = 1; pLinePoints[1].style = 5; pLinePoints[2] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt0); pLinePoints[2].style = 1; pLinePoints[3] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt1); pLinePoints[3].style = 5; acCounter = 4; break; case 23194000: pts = new Array(4); for (j = 0; j < 4; j++) { pts[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j]); } dRadius = armyc2.c2sd.JavaLineArray.lineutility.CalcDistanceDouble(pLinePoints[0], pLinePoints[1]); d = armyc2.c2sd.JavaLineArray.lineutility.CalcDistanceToLineDouble(pLinePoints[0], pLinePoints[1], pLinePoints[2]); pLinePoints[0] = armyc2.c2sd.JavaLineArray.lineutility.ExtendTrueLinePerpDouble(pts[0], pts[1], pts[1], d, 0); pLinePoints[1] = armyc2.c2sd.JavaLineArray.lineutility.ExtendTrueLinePerpDouble(pts[0], pts[1], pts[0], d, 5); pLinePoints[2] = armyc2.c2sd.JavaLineArray.lineutility.ExtendTrueLinePerpDouble(pts[0], pts[1], pts[1], -d, 0); pLinePoints[3] = armyc2.c2sd.JavaLineArray.lineutility.ExtendTrueLinePerpDouble(pts[0], pts[1], pts[0], -d, 5); midpt = armyc2.c2sd.JavaLineArray.lineutility.MidPointDouble(pts[0], pts[1], 0); midpt = armyc2.c2sd.JavaLineArray.lineutility.ExtendLineDouble(pts[0], midpt, d); pLinePoints[4] = armyc2.c2sd.JavaLineArray.lineutility.ExtendAngledLine(pts[0], pts[1], midpt, 105, dRadius / 2); pLinePoints[5] = armyc2.c2sd.JavaLineArray.lineutility.ExtendAngledLine(pts[0], pts[1], midpt, -75, dRadius / 2); pLinePoints[5].style = 5; midpt = armyc2.c2sd.JavaLineArray.lineutility.MidPointDouble(pts[0], pts[1], 0); midpt = armyc2.c2sd.JavaLineArray.lineutility.ExtendLineDouble(pts[1], midpt, d); pLinePoints[6] = armyc2.c2sd.JavaLineArray.lineutility.ExtendAngledLine(pts[0], pts[1], midpt, 105, dRadius / 2); pLinePoints[7] = armyc2.c2sd.JavaLineArray.lineutility.ExtendAngledLine(pts[0], pts[1], midpt, -75, dRadius / 2); pLinePoints[7].style = 5; acCounter = 8; break; case 221311000: case 22340000: case 2237000: armyc2.c2sd.JavaLineArray.arraysupport.AreaWithCenterFeatureDouble(pLinePoints, vblCounter, lineType); acCounter = vblCounter; //armyc2.c2sd.JavaLineArray.arraysupport.FillPoints(pLinePoints, vblCounter, points); break; case 22431100: for (j = 0; j < vblCounter; j++) pLinePoints[j].style = 1; acCounter = vblCounter; break; case 22350000: //dmaf armyc2.c2sd.JavaLineArray.arraysupport.AreaWithCenterFeatureDouble(pLinePoints, vblCounter, lineType); pLinePoints[vblCounter - 1].style = 5; armyc2.c2sd.JavaLineArray.arraysupport.FillPoints(pLinePoints, vblCounter, points); xPoints = armyc2.c2sd.JavaLineArray.lineutility.LineOfXPoints(pOriginalLinePoints); for (j = 0; j < xPoints.size(); j++) { points.add(xPoints.get(j)); } acCounter = points.size(); break; case 23340000: bolVertical = armyc2.c2sd.JavaLineArray.lineutility.CalcTrueSlopeDouble(pt0, pt1, m); if (bolVertical === 0) { if (pt0.y > pt1.y) { direction = 0; } else { direction = 1; } } if (bolVertical!== 0 && m.value[0] <= 1) { if (pt0.x < pt1.x) { direction = 3; } else { direction = 2; } } if (bolVertical!== 0 && m.value[0] > 1) { if (pt0.x < pt1.x && pt0.y > pt1.y) { direction = 1; } if (pt0.x < pt1.x && pt0.y < pt1.y) { direction = 0; } if (pt0.x > pt1.x && pt0.y > pt1.y) { direction = 1; } if (pt0.x > pt1.x && pt0.y < pt1.y) { direction = 0; } } if (dMBR / 20 > armyc2.c2sd.JavaLineArray.arraysupport.maxLength) { dMBR = 20 * armyc2.c2sd.JavaLineArray.arraysupport.maxLength; } if (dMBR / 20 < armyc2.c2sd.JavaLineArray.arraysupport.minLength) { dMBR = 20 * armyc2.c2sd.JavaLineArray.arraysupport.minLength; } if (dMBR < 250) dMBR = 250; if (dMBR > 500) dMBR = 500; pLinePoints[0] = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pt0, pt1, pt0, direction, dMBR / 20); pLinePoints[1] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt0); pLinePoints[2] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pt1); pLinePoints[3] = armyc2.c2sd.JavaLineArray.lineutility.ExtendDirectedLine(pt0, pt1, pt1, direction, dMBR / 20); acCounter = 4; break; case 211400000: armyc2.c2sd.JavaLineArray.arraysupport.GetIsolatePointsDouble(pLinePoints, lineType, converter); acCounter = 50; break; case 212600000: case 212500000: armyc2.c2sd.JavaLineArray.arraysupport.GetIsolatePointsDouble(pLinePoints, lineType, converter); acCounter = 50; //armyc2.c2sd.JavaLineArray.arraysupport.FillPoints(pLinePoints, acCounter, points); break; case 211600000: armyc2.c2sd.JavaLineArray.arraysupport.GetIsolatePointsDouble(pLinePoints, lineType, converter); acCounter = 32; break; case 211900000: armyc2.c2sd.JavaLineArray.arraysupport.GetIsolatePointsDouble(pLinePoints, lineType, converter); acCounter = 75; break; case 212100000: armyc2.c2sd.JavaLineArray.arraysupport.GetIsolatePointsDouble(pLinePoints, lineType, converter); acCounter = 29; break; case 23173000: if(rev > 0) { //2525C or higher switch first and last point. Order changed in 2525C var swapPt = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[0]); pLinePoints[0] = pLinePoints[1]; pLinePoints[1] = swapPt; }//*/ armyc2.c2sd.JavaLineArray.arraysupport.GetIsolatePointsDouble(pLinePoints, lineType); acCounter = 29; break; case 22624000: acCounter = armyc2.c2sd.JavaLineArray.arraysupport.GetZONEPointsDouble2(pLinePoints, lineType, vblSaveCounter); break; case 23111001: pUpperLinePoints = new Array(vblSaveCounter); pLowerLinePoints = new Array(vblSaveCounter); pUpperLowerLinePoints = new Array(2 * vblCounter); for (j = 0; j < vblSaveCounter; j++) pLowerLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j]); for (j = 0; j < vblSaveCounter; j++) pUpperLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLinePoints[j]); pUpperLinePoints = armyc2.c2sd.JavaLineArray.Channels.CoordIL2Double(1, pUpperLinePoints, 1, vblSaveCounter, lineType, 30); pLowerLinePoints = armyc2.c2sd.JavaLineArray.Channels.CoordIL2Double(1, pLowerLinePoints, 0, vblSaveCounter, lineType, 30); for (j = 0; j < vblSaveCounter; j++) pUpperLowerLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pUpperLinePoints[j]); for (j = 0; j < vblSaveCounter; j++) pUpperLowerLinePoints[j + vblSaveCounter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pLowerLinePoints[vblSaveCounter - j - 1]); pUpperLowerLinePoints[2 * vblSaveCounter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pUpperLowerLinePoints[0]); vblCounter = armyc2.c2sd.JavaLineArray.arraysupport.GetZONEPointsDouble2(pUpperLowerLinePoints, lineType, 2 * vblSaveCounter + 1); for (j = 0; j < vblCounter; j++) pLinePoints[j] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pUpperLowerLinePoints[j]); acCounter = vblCounter; break; //case 22236000: case 22238000: case 22239000: case 22624000: //case 22625000: //case 22626000: case 243213100: case 243214100: case 23111000: case 23113000: case 23115000: case 23114000: case 23350000: case 22134000: acCounter = armyc2.c2sd.JavaLineArray.arraysupport.GetZONEPointsDouble2(pLinePoints, lineType, vblSaveCounter); break; case 23152100: case 23155100: case 23134000: case 23112000: acCounter = armyc2.c2sd.JavaLineArray.arraysupport.GetATWallPointsDouble2(pLinePoints, lineType, vblSaveCounter); break; case 22528000: for (j = 0; j < vblCounter; j++) pLinePoints[j].style = 1; acCounter = vblCounter; break; case 22421000: armyc2.c2sd.JavaLineArray.arraysupport.CoordFEBADouble(pLinePoints, vblCounter); acCounter = pLinePoints.length; break; case 22224000: case 22222000: if (rev === 0) { dMRR = pOriginalLinePoints[0].style; if (dMRR <= 0) { dMRR = 1; } armyc2.c2sd.JavaLineArray.lineutility.GetSAAFRSegment(pLinePoints, lineType, dMRR, rev); acCounter = 6; } if (rev === 1) { return armyc2.c2sd.JavaLineArray.arraysupport.GetLineArray2Double(22223000, pLinePoints, vblCounter, vblSaveCounter, shapes, clipBounds, rev); } break; case 22222001: case 22224001: case 22225000: case 22223000: case 22221000: var bolSegmentAC = false; //uncomment the next line if the air corridor is segmented bolSegmentAC = true; dMRR = armyc2.c2sd.JavaLineArray.arraysupport.dACP; armyc2.c2sd.JavaLineArray.lineutility.InitializePOINT2Array(acPoints); armyc2.c2sd.JavaLineArray.lineutility.InitializePOINT2Array(arcPts); acCounter = 0; if (!bolSegmentAC) { for (j = 0; j < vblSaveCounter; j++) if (pOriginalLinePoints[j].style <= 0) pOriginalLinePoints[j].style = 1; } for (j = 0; j < vblSaveCounter - 1; j++) { //use Math.abs here in case it's a negative value used when segmenting dMBR = Math.abs(pOriginalLinePoints[j].style); acPoints[0] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pOriginalLinePoints[j]); acPoints[1] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pOriginalLinePoints[j + 1]); armyc2.c2sd.JavaLineArray.lineutility.GetSAAFRSegment(acPoints, lineType, dMBR, rev); for (k = 0; k < 6; k++) { pLinePoints[acCounter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(acPoints[k]); acCounter++; } } var currentCircleSize = 0; if (!bolSegmentAC) { for (j = 0; j < vblSaveCounter - 1; j++) { currentCircleSize = pOriginalLinePoints[j].style; //nextCircleSize = pOriginalLinePoints[j + 1].style; arcPts[0] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pOriginalLinePoints[j]); dMBR = currentCircleSize; armyc2.c2sd.JavaLineArray.lineutility.CalcCircleDouble(arcPts[0], dMBR, 26, arcPts, 0); arcPts[25].style = 5; for (k = 0; k < 26; k++) { pLinePoints[acCounter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(arcPts[k]); acCounter++; } arcPts[0] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pOriginalLinePoints[j + 1]); dMBR = currentCircleSize; armyc2.c2sd.JavaLineArray.lineutility.CalcCircleDouble(arcPts[0], dMBR, 26, arcPts, 0); arcPts[25].style = 5; for (k = 0; k < 26; k++) { pLinePoints[acCounter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(arcPts[k]); acCounter++; } } } else //segmented corridor { var lastCircleSize=0; var lastCirclePoint=null; for (j = 0; j < vblSaveCounter; j++) { currentCircleSize = pOriginalLinePoints[j].style; if(j===0) { lastCircleSize=currentCircleSize; lastCirclePoint=pOriginalLinePoints[j]; continue; } if(currentCircleSize < 0) continue; //the current circle point arcPts[0] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(pOriginalLinePoints[j]); dMBR = lastCircleSize; armyc2.c2sd.JavaLineArray.lineutility.CalcCircleDouble(arcPts[0], dMBR, 26, arcPts, 0); arcPts[25].style = 5; for (k = 0; k < 26; k++) { pLinePoints[acCounter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(arcPts[k]); acCounter++; } //the previous circle point arcPts[0] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(lastCirclePoint); armyc2.c2sd.JavaLineArray.lineutility.CalcCircleDouble(arcPts[0], dMBR, 26, arcPts, 0); arcPts[25].style = 5; for (k = 0; k < 26; k++) { pLinePoints[acCounter] = armyc2.c2sd.JavaLineArray.lineutility.setPOINT2(arcPts[k]); acCounter++; } //set the last values lastCircleSize=currentCircleSize; lastCirclePoint=pOriginalLinePoints[j]; } //get the middle line for Rev B AC, MRR, UAV, and LLTR //Symbology_2525Bch2_USAS_13_14 //if(rev === armyc2.c2sd.renderer.utilities.RendererSettings.Symbology_2525Bch2_USAS_13_14 && lineType!== 22223000) //SAAFR if(rev === armyc2.c2sd.renderer.utilities
67,287
thestackv1_concat_by_repo-long/65536-65536
377219122228b5bc7c737d7c}{jwt\+Token\+Provider}} \item final \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service}{User\+Service}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_auth_controller_ada52ba0a7937f8a49ad5eff1c737bf76}{user\+Service}} \item final B\+Crypt\+Password\+Encoder \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_auth_controller_ac630244d26d50aa5d44e5c01292dc831}{b\+Crypt\+Password\+Encoder}} \end{DoxyCompactItemize} \doxysubsection{Конструктор(ы)} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_auth_controller_a9db288c052de720a1d8de4430540e54a}\label{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_auth_controller_a9db288c052de720a1d8de4430540e54a}} \index{crutchesbicycles.studyhelper.controller.AuthController@{crutchesbicycles.studyhelper.controller.AuthController}!AuthController@{AuthController}} \index{AuthController@{AuthController}!crutchesbicycles.studyhelper.controller.AuthController@{crutchesbicycles.studyhelper.controller.AuthController}} \doxysubsubsection{\texorpdfstring{AuthController()}{AuthController()}} {\footnotesize\ttfamily crutchesbicycles.\+studyhelper.\+controller.\+Auth\+Controller.\+Auth\+Controller (\begin{DoxyParamCaption}\item[{Authentication\+Manager}]{authentication\+Manager, }\item[{\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_token_provider}{Jwt\+Token\+Provider}}}]{jwt\+Token\+Provider, }\item[{\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service}{User\+Service}}}]{user\+Service, }\item[{B\+Crypt\+Password\+Encoder}]{b\+Crypt\+Password\+Encoder }\end{DoxyParamCaption})} \doxysubsection{Методы} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_auth_controller_a73c4d5a4a75399515e9369416fa29269}\label{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_auth_controller_a73c4d5a4a75399515e9369416fa29269}} \index{crutchesbicycles.studyhelper.controller.AuthController@{crutchesbicycles.studyhelper.controller.AuthController}!login@{login}} \index{login@{login}!crutchesbicycles.studyhelper.controller.AuthController@{crutchesbicycles.studyhelper.controller.AuthController}} \doxysubsubsection{\texorpdfstring{login()}{login()}} {\footnotesize\ttfamily Response\+Entity$<$?$>$ crutchesbicycles.\+studyhelper.\+controller.\+Auth\+Controller.\+login (\begin{DoxyParamCaption}\item[{@Request\+Param String}]{email, }\item[{@Request\+Param String}]{password }\end{DoxyParamCaption})} Вход в систему ~\newline {\bfseries{Путь\+: /api/auth/login}} ~\newline Тип запроса\+: P\+O\+ST ~\newline \begin{DoxyParams}{Аргументы} {\em email} & -- почта пользователя \\ \hline {\em password} & -- пароль в открытом виде (шифруется на сервере) \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Возвращает} jwt\+Token (expired\+\_\+time=8640000ms (1 день)) \end{DoxyReturn} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_auth_controller_afc48bc0a40cf6bcc361d122e7bab3e88}\label{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_auth_controller_afc48bc0a40cf6bcc361d122e7bab3e88}} \index{crutchesbicycles.studyhelper.controller.AuthController@{crutchesbicycles.studyhelper.controller.AuthController}!register@{register}} \index{register@{register}!crutchesbicycles.studyhelper.controller.AuthController@{crutchesbicycles.studyhelper.controller.AuthController}} \doxysubsubsection{\texorpdfstring{register()}{register()}} {\footnotesize\ttfamily Response\+Entity$<$?$>$ crutchesbicycles.\+studyhelper.\+controller.\+Auth\+Controller.\+register (\begin{DoxyParamCaption}\item[{@Request\+Param String}]{email, }\item[{@Request\+Param String}]{password, }\item[{@Request\+Param Integer}]{i }\end{DoxyParamCaption})} Создать аккаунт в системе ~\newline {\bfseries{Путь\+: /api/auth/register}} ~\newline \begin{DoxyParams}{Аргументы} {\em email} & -- email пользователя \\ \hline {\em password} & -- пароль пользователя \\ \hline {\em i} & -- тип пользователя (0 -- user, 1 -- староста+user, 2 -- admin+user+староста) \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Возвращает} Http\+Status OK и созданный аккаунт (\mbox{\hyperlink{}{Account}}) \end{DoxyReturn} \doxysubsection{Данные класса} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_auth_controller_a919b18f27af062c8717828111c330901}\label{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_auth_controller_a919b18f27af062c8717828111c330901}} \index{crutchesbicycles.studyhelper.controller.AuthController@{crutchesbicycles.studyhelper.controller.AuthController}!authenticationManager@{authenticationManager}} \index{authenticationManager@{authenticationManager}!crutchesbicycles.studyhelper.controller.AuthController@{crutchesbicycles.studyhelper.controller.AuthController}} \doxysubsubsection{\texorpdfstring{authenticationManager}{authenticationManager}} {\footnotesize\ttfamily final Authentication\+Manager crutchesbicycles.\+studyhelper.\+controller.\+Auth\+Controller.\+authentication\+Manager\hspace{0.3cm}{\ttfamily [private]}} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_auth_controller_ac630244d26d50aa5d44e5c01292dc831}\label{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_auth_controller_ac630244d26d50aa5d44e5c01292dc831}} \index{crutchesbicycles.studyhelper.controller.AuthController@{crutchesbicycles.studyhelper.controller.AuthController}!bCryptPasswordEncoder@{bCryptPasswordEncoder}} \index{bCryptPasswordEncoder@{bCryptPasswordEncoder}!crutchesbicycles.studyhelper.controller.AuthController@{crutchesbicycles.studyhelper.controller.AuthController}} \doxysubsubsection{\texorpdfstring{bCryptPasswordEncoder}{bCryptPasswordEncoder}} {\footnotesize\ttfamily final B\+Crypt\+Password\+Encoder crutchesbicycles.\+studyhelper.\+controller.\+Auth\+Controller.\+b\+Crypt\+Password\+Encoder\hspace{0.3cm}{\ttfamily [private]}} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_auth_controller_aa78a2dff377219122228b5bc7c737d7c}\label{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_auth_controller_aa78a2dff377219122228b5bc7c737d7c}} \index{crutchesbicycles.studyhelper.controller.AuthController@{crutchesbicycles.studyhelper.controller.AuthController}!jwtTokenProvider@{jwtTokenProvider}} \index{jwtTokenProvider@{jwtTokenProvider}!crutchesbicycles.studyhelper.controller.AuthController@{crutchesbicycles.studyhelper.controller.AuthController}} \doxysubsubsection{\texorpdfstring{jwtTokenProvider}{jwtTokenProvider}} {\footnotesize\ttfamily final \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_token_provider}{Jwt\+Token\+Provider}} crutchesbicycles.\+studyhelper.\+controller.\+Auth\+Controller.\+jwt\+Token\+Provider\hspace{0.3cm}{\ttfamily [private]}} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_auth_controller_ada52ba0a7937f8a49ad5eff1c737bf76}\label{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_auth_controller_ada52ba0a7937f8a49ad5eff1c737bf76}} \index{crutchesbicycles.studyhelper.controller.AuthController@{crutchesbicycles.studyhelper.controller.AuthController}!userService@{userService}} \index{userService@{userService}!crutchesbicycles.studyhelper.controller.AuthController@{crutchesbicycles.studyhelper.controller.AuthController}} \doxysubsubsection{\texorpdfstring{userService}{userService}} {\footnotesize\ttfamily final \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service}{User\+Service}} crutchesbicycles.\+studyhelper.\+controller.\+Auth\+Controller.\+user\+Service\hspace{0.3cm}{\ttfamily [private]}} Объявления и описания членов класса находятся в файле\+:\begin{DoxyCompactItemize} \item /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/controller/\mbox{\hyperlink{_auth_controller_8java}{Auth\+Controller.\+java}}\end{DoxyCompactItemize} ======================= File: code_doc/latex/classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test.tex ======================= \hypertarget{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test}{}\doxysection{Класс crutchesbicycles.\+studyhelper.\+Teacher\+Controller\+Test} \label{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test}\index{crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}} \doxysubsection*{Открытые члены} \begin{DoxyCompactItemize} \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_aed864de52703535d1c6bae05736135d9}{get\+All\+Teachers\+Test}} () throws Exception \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a935ca2ac589b7a978db6c148b85af7db}{get\+Teacher\+By\+Id\+Test}} () throws Exception \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a8ee9664134f3b4349b801af11c8b03ca}{create\+Teacher\+Test}} () throws Exception \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a3266f6b6c897ef7769dd671bbd82fa4b}{update\+Teacher\+Test}} () throws Exception \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a3584dea49b311f166190cbf5b22a7533}{Teacher\+Not\+Found\+Exception\+Test}} () throws Exception \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_ad5aab5a34e7903a695d66041a9e81079}{delete\+Teacher\+Test}} () throws Exception \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a865eca23bf18548055607c1369801917}{get\+Teacher\+Subjects\+Test}} () throws Exception \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_ae106844998c6e786b68c59dd1a29a91b}{create\+Subject\+Test}} () throws Exception \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a04e19f5fe41ad7bddd6161934ffe434b}{Subject\+Not\+Found\+Exception}} () throws Exception \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_af183429a42322d5589f130223e29c45d}{get\+Subject\+By\+Id}} () throws Exception \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a3be5f9e6110bcc4b85fbf47f5b7c7f3b}{delete\+Teacher\+Subject\+Test}} () throws Exception \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_ab056d9554a9b985f37d531b8d88cd4ad}{Teacher\+Subject\+Not\+Found\+Test}} () throws Exception \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a6147929170128f9bb2211136351c65a4}{get\+Group\+By\+Teacher\+Test}} () throws Exception \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a9e9f18d0c5cf340af351ad9826bb931c}{create\+Teacher\+Group\+Test}} () throws Exception \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_aa840f3e126503013ca829846563bf8bf}{delete\+Teacher\+Group\+Test}} () throws Exception \end{DoxyCompactItemize} \doxysubsection*{Закрытые данные} \begin{DoxyCompactItemize} \item Mock\+Mvc \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a12e7df0baddace525285d2312c3778d5}{mock\+Mvc}} \end{DoxyCompactItemize} \doxysubsection{Методы} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_ae106844998c6e786b68c59dd1a29a91b}\label{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_ae106844998c6e786b68c59dd1a29a91b}} \index{crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}!createSubjectTest@{createSubjectTest}} \index{createSubjectTest@{createSubjectTest}!crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}} \doxysubsubsection{\texorpdfstring{createSubjectTest()}{createSubjectTest()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+Teacher\+Controller\+Test.\+create\+Subject\+Test (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) throws Exception} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a9e9f18d0c5cf340af351ad9826bb931c}\label{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a9e9f18d0c5cf340af351ad9826bb931c}} \index{crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}!createTeacherGroupTest@{createTeacherGroupTest}} \index{createTeacherGroupTest@{createTeacherGroupTest}!crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}} \doxysubsubsection{\texorpdfstring{createTeacherGroupTest()}{createTeacherGroupTest()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+Teacher\+Controller\+Test.\+create\+Teacher\+Group\+Test (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) throws Exception} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a8ee9664134f3b4349b801af11c8b03ca}\label{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a8ee9664134f3b4349b801af11c8b03ca}} \index{crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}!createTeacherTest@{createTeacherTest}} \index{createTeacherTest@{createTeacherTest}!crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}} \doxysubsubsection{\texorpdfstring{createTeacherTest()}{createTeacherTest()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+Teacher\+Controller\+Test.\+create\+Teacher\+Test (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) throws Exception} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_aa840f3e126503013ca829846563bf8bf}\label{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_aa840f3e126503013ca829846563bf8bf}} \index{crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}!deleteTeacherGroupTest@{deleteTeacherGroupTest}} \index{deleteTeacherGroupTest@{deleteTeacherGroupTest}!crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}} \doxysubsubsection{\texorpdfstring{deleteTeacherGroupTest()}{deleteTeacherGroupTest()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+Teacher\+Controller\+Test.\+delete\+Teacher\+Group\+Test (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) throws Exception} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a3be5f9e6110bcc4b85fbf47f5b7c7f3b}\label{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a3be5f9e6110bcc4b85fbf47f5b7c7f3b}} \index{crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}!deleteTeacherSubjectTest@{deleteTeacherSubjectTest}} \index{deleteTeacherSubjectTest@{deleteTeacherSubjectTest}!crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}} \doxysubsubsection{\texorpdfstring{deleteTeacherSubjectTest()}{deleteTeacherSubjectTest()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+Teacher\+Controller\+Test.\+delete\+Teacher\+Subject\+Test (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) throws Exception} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_ad5aab5a34e7903a695d66041a9e81079}\label{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_ad5aab5a34e7903a695d66041a9e81079}} \index{crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}!deleteTeacherTest@{deleteTeacherTest}} \index{deleteTeacherTest@{deleteTeacherTest}!crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}} \doxysubsubsection{\texorpdfstring{deleteTeacherTest()}{deleteTeacherTest()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+Teacher\+Controller\+Test.\+delete\+Teacher\+Test (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) throws Exception} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_aed864de52703535d1c6bae05736135d9}\label{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_aed864de52703535d1c6bae05736135d9}} \index{crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}!getAllTeachersTest@{getAllTeachersTest}} \index{getAllTeachersTest@{getAllTeachersTest}!crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}} \doxysubsubsection{\texorpdfstring{getAllTeachersTest()}{getAllTeachersTest()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+Teacher\+Controller\+Test.\+get\+All\+Teachers\+Test (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) throws Exception} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a6147929170128f9bb2211136351c65a4}\label{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a6147929170128f9bb2211136351c65a4}} \index{crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}!getGroupByTeacherTest@{getGroupByTeacherTest}} \index{getGroupByTeacherTest@{getGroupByTeacherTest}!crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}} \doxysubsubsection{\texorpdfstring{getGroupByTeacherTest()}{getGroupByTeacherTest()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+Teacher\+Controller\+Test.\+get\+Group\+By\+Teacher\+Test (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) throws Exception} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_af183429a42322d5589f130223e29c45d}\label{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_af183429a42322d5589f130223e29c45d}} \index{crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}!getSubjectById@{getSubjectById}} \index{getSubjectById@{getSubjectById}!crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}} \doxysubsubsection{\texorpdfstring{getSubjectById()}{getSubjectById()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+Teacher\+Controller\+Test.\+get\+Subject\+By\+Id (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) throws Exception} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a935ca2ac589b7a978db6c148b85af7db}\label{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a935ca2ac589b7a978db6c148b85af7db}} \index{crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}!getTeacherByIdTest@{getTeacherByIdTest}} \index{getTeacherByIdTest@{getTeacherByIdTest}!crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}} \doxysubsubsection{\texorpdfstring{getTeacherByIdTest()}{getTeacherByIdTest()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+Teacher\+Controller\+Test.\+get\+Teacher\+By\+Id\+Test (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) throws Exception} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a865eca23bf18548055607c1369801917}\label{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a865eca23bf18548055607c1369801917}} \index{crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}!getTeacherSubjectsTest@{getTeacherSubjectsTest}} \index{getTeacherSubjectsTest@{getTeacherSubjectsTest}!crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}} \doxysubsubsection{\texorpdfstring{getTeacherSubjectsTest()}{getTeacherSubjectsTest()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+Teacher\+Controller\+Test.\+get\+Teacher\+Subjects\+Test (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) throws Exception} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a04e19f5fe41ad7bddd6161934ffe434b}\label{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a04e19f5fe41ad7bddd6161934ffe434b}} \index{crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}!SubjectNotFoundException@{SubjectNotFoundException}} \index{SubjectNotFoundException@{SubjectNotFoundException}!crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}} \doxysubsubsection{\texorpdfstring{SubjectNotFoundException()}{SubjectNotFoundException()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+Teacher\+Controller\+Test.\+Subject\+Not\+Found\+Exception (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) throws Exception} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a3584dea49b311f166190cbf5b22a7533}\label{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a3584dea49b311f166190cbf5b22a7533}} \index{crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}!TeacherNotFoundExceptionTest@{TeacherNotFoundExceptionTest}} \index{TeacherNotFoundExceptionTest@{TeacherNotFoundExceptionTest}!crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}} \doxysubsubsection{\texorpdfstring{TeacherNotFoundExceptionTest()}{TeacherNotFoundExceptionTest()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+Teacher\+Controller\+Test.\+Teacher\+Not\+Found\+Exception\+Test (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) throws Exception} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_ab056d9554a9b985f37d531b8d88cd4ad}\label{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_ab056d9554a9b985f37d531b8d88cd4ad}} \index{crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}!TeacherSubjectNotFoundTest@{TeacherSubjectNotFoundTest}} \index{TeacherSubjectNotFoundTest@{TeacherSubjectNotFoundTest}!crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}} \doxysubsubsection{\texorpdfstring{TeacherSubjectNotFoundTest()}{TeacherSubjectNotFoundTest()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+Teacher\+Controller\+Test.\+Teacher\+Subject\+Not\+Found\+Test (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) throws Exception} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a3266f6b6c897ef7769dd671bbd82fa4b}\label{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a3266f6b6c897ef7769dd671bbd82fa4b}} \index{crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}!updateTeacherTest@{updateTeacherTest}} \index{updateTeacherTest@{updateTeacherTest}!crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}} \doxysubsubsection{\texorpdfstring{updateTeacherTest()}{updateTeacherTest()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+Teacher\+Controller\+Test.\+update\+Teacher\+Test (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) throws Exception} \doxysubsection{Данные класса} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a12e7df0baddace525285d2312c3778d5}\label{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test_a12e7df0baddace525285d2312c3778d5}} \index{crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}!mockMvc@{mockMvc}} \index{mockMvc@{mockMvc}!crutchesbicycles.studyhelper.TeacherControllerTest@{crutchesbicycles.studyhelper.TeacherControllerTest}} \doxysubsubsection{\texorpdfstring{mockMvc}{mockMvc}} {\footnotesize\ttfamily Mock\+Mvc crutchesbicycles.\+studyhelper.\+Teacher\+Controller\+Test.\+mock\+Mvc\hspace{0.3cm}{\ttfamily [private]}} Объявления и описания членов класса находятся в файле\+:\begin{DoxyCompactItemize} \item /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/test/java/crutchesbicycles/studyhelper/\mbox{\hyperlink{_teacher_controller_test_8java}{Teacher\+Controller\+Test.\+java}}\end{DoxyCompactItemize} ======================= File: code_doc/latex/classcrutchesbicycles_1_1studyhelper_1_1_group_material_controller_test.tex ======================= <reponame>vgtstptlk/StudyHelper_REST_API \hypertarget{classcrutchesbicycles_1_1studyhelper_1_1_group_material_controller_test}{}\doxysection{Класс crutchesbicycles.\+studyhelper.\+Group\+Material\+Controller\+Test} \label{classcrutchesbicycles_1_1studyhelper_1_1_group_material_controller_test}\index{crutchesbicycles.studyhelper.GroupMaterialControllerTest@{crutchesbicycles.studyhelper.GroupMaterialControllerTest}} \doxysubsection*{Открытые члены} \begin{DoxyCompactItemize} \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_group_material_controller_test_aa74688bb4f4310c3b95a52ac3358378b}{get\+Group\+Material\+Test}} () throws Exception \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_group_material_controller_test_a1e1bde169a1300c7e3a3873fc8508cb9}{Group\+Not\+Found\+Exception\+Test}} () throws Exception \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_group_material_controller_test_a1bb2a7882b1ecb7439c55de4904a4065}{get\+Group\+Material\+By\+Id\+Test}} () throws Exception \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_group_material_controller_test_add19319466a7ece2396efd5062b528d1}{Group\+Material\+Not\+Found\+Exception\+Test}} () throws Exception \end{DoxyCompactItemize} \doxysubsection*{Закрытые данные} \begin{DoxyCompactItemize} \item Mock\+Mvc \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_group_material_controller_test_a20a1a9f2c5fc77a9eba3403b6997ee81}{mock\+Mvc}} \end{DoxyCompactItemize} \doxysubsection{Методы} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1_group_material_controller_test_a1bb2a7882b1ecb7439c55de4904a4065}\label{classcrutchesbicycles_1_1studyhelper_1_1_group_material_controller_test_a1bb2a7882b1ecb7439c55de4904a4065}} \index{crutchesbicycles.studyhelper.GroupMaterialControllerTest@{crutchesbicycles.studyhelper.GroupMaterialControllerTest}!getGroupMaterialByIdTest@{getGroupMaterialByIdTest}} \index{getGroupMaterialByIdTest@{getGroupMaterialByIdTest}!crutchesbicycles.studyhelper.GroupMaterialControllerTest@{crutchesbicycles.studyhelper.GroupMaterialControllerTest}} \doxysubsubsection{\texorpdfstring{getGroupMaterialByIdTest()}{getGroupMaterialByIdTest()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+Group\+Material\+Controller\+Test.\+get\+Group\+Material\+By\+Id\+Test (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) throws Exception} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1_group_material_controller_test_aa74688bb4f4310c3b95a52ac3358378b}\label{classcrutchesbicycles_1_1studyhelper_1_1_group_material_controller_test_aa74688bb4f4310c3b95a52ac3358378b}} \index{crutchesbicycles.studyhelper.GroupMaterialControllerTest@{crutchesbicycles.studyhelper.GroupMaterialControllerTest}!getGroupMaterialTest@{getGroupMaterialTest}} \index{getGroupMaterialTest@{getGroupMaterialTest}!crutchesbicycles.studyhelper.GroupMaterialControllerTest@{crutchesbicycles.studyhelper.GroupMaterialControllerTest}} \doxysubsubsection{\texorpdfstring{getGroupMaterialTest()}{getGroupMaterialTest()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+Group\+Material\+Controller\+Test.\+get\+Group\+Material\+Test (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) throws Exception} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1_group_material_controller_test_add19319466a7ece2396efd5062b528d1}\label{classcrutchesbicycles_1_1studyhelper_1_1_group_material_controller_test_add19319466a7ece2396efd5062b528d1}} \index{crutchesbicycles.studyhelper.GroupMaterialControllerTest@{crutchesbicycles.studyhelper.GroupMaterialControllerTest}!GroupMaterialNotFoundExceptionTest@{GroupMaterialNotFoundExceptionTest}} \index{GroupMaterialNotFoundExceptionTest@{GroupMaterialNotFoundExceptionTest}!crutchesbicycles.studyhelper.GroupMaterialControllerTest@{crutchesbicycles.studyhelper.GroupMaterialControllerTest}} \doxysubsubsection{\texorpdfstring{GroupMaterialNotFoundExceptionTest()}{GroupMaterialNotFoundExceptionTest()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+Group\+Material\+Controller\+Test.\+Group\+Material\+Not\+Found\+Exception\+Test (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) throws Exception} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1_group_material_controller_test_a1e1bde169a1300c7e3a3873fc8508cb9}\label{classcrutchesbicycles_1_1studyhelper_1_1_group_material_controller_test_a1e1bde169a1300c7e3a3873fc8508cb9}} \index{crutchesbicycles.studyhelper.GroupMaterialControllerTest@{crutchesbicycles.studyhelper.GroupMaterialControllerTest}!GroupNotFoundExceptionTest@{GroupNotFoundExceptionTest}} \index{GroupNotFoundExceptionTest@{GroupNotFoundExceptionTest}!crutchesbicycles.studyhelper.GroupMaterialControllerTest@{crutchesbicycles.studyhelper.GroupMaterialControllerTest}} \doxysubsubsection{\texorpdfstring{GroupNotFoundExceptionTest()}{GroupNotFoundExceptionTest()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+Group\+Material\+Controller\+Test.\+Group\+Not\+Found\+Exception\+Test (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) throws Exception} \doxysubsection{Данные класса} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1_group_material_controller_test_a20a1a9f2c5fc77a9eba3403b6997ee81}\label{classcrutchesbicycles_1_1studyhelper_1_1_group_material_controller_test_a20a1a9f2c5fc77a9eba3403b6997ee81}} \index{crutchesbicycles.studyhelper.GroupMaterialControllerTest@{crutchesbicycles.studyhelper.GroupMaterialControllerTest}!mockMvc@{mockMvc}} \index{mockMvc@{mockMvc}!crutchesbicycles.studyhelper.GroupMaterialControllerTest@{crutchesbicycles.studyhelper.GroupMaterialControllerTest}} \doxysubsubsection{\texorpdfstring{mockMvc}{mockMvc}} {\footnotesize\ttfamily Mock\+Mvc crutchesbicycles.\+studyhelper.\+Group\+Material\+Controller\+Test.\+mock\+Mvc\hspace{0.3cm}{\ttfamily [private]}} Объявления и описания членов класса находятся в файле\+:\begin{DoxyCompactItemize} \item /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/test/java/crutchesbicycles/studyhelper/\mbox{\hyperlink{_group_material_controller_test_8java}{Group\+Material\+Controller\+Test.\+java}}\end{DoxyCompactItemize} ======================= File: code_doc/latex/dir_c05c5de453e9b1beaef2d68df4b09eb8.tex ======================= <reponame>vgtstptlk/StudyHelper_REST_API \hypertarget{dir_c05c5de453e9b1beaef2d68df4b09eb8}{}\doxysection{Содержание директории /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper} \label{dir_c05c5de453e9b1beaef2d68df4b09eb8}\index{Содержание директории /Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper@{Содержание директории /Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper}} \doxysubsection*{Директории} \begin{DoxyCompactItemize} \item директория \mbox{\hyperlink{dir_52779362bdbc3b824e6e39dcd3242bac}{config}} \item директория \mbox{\hyperlink{dir_c4203ca0680ebd7e598580e00a991eae}{controller}} \item директория \mbox{\hyperlink{dir_1f5c676ed1e1f30a2e5d48b22bfb4792}{domain}} \item директория \mbox{\hyperlink{dir_c1e416f5ecfd6a4711c6800639d5aa7d}{exception}} \item директория \mbox{\hyperlink{dir_c713ea5e9b52a878d7c32d5f5a999cdb}{repos}} \item директория \mbox{\hyperlink{dir_804ff7817587d1c55e4975cd9b617aba}{security}} \item директория \mbox{\hyperlink{dir_569fb81e9673d811aea414157d4552cb}{service}} \end{DoxyCompactItemize} \doxysubsection*{Файлы} \begin{DoxyCompactItemize} \item файл \mbox{\hyperlink{_studyhelper_application_8java}{Studyhelper\+Application.\+java}} \end{DoxyCompactItemize} ======================= File: code_doc/latex/dir_1f5c676ed1e1f30a2e5d48b22bfb4792.tex ======================= <filename>code_doc/latex/dir_1f5c676ed1e1f30a2e5d48b22bfb4792.tex \hypertarget{dir_1f5c676ed1e1f30a2e5d48b22bfb4792}{}\doxysection{Содержание директории /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/domain} \label{dir_1f5c676ed1e1f30a2e5d48b22bfb4792}\index{Содержание директории /Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/domain@{Содержание директории /Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/domain}} \doxysubsection*{Файлы} \begin{DoxyCompactItemize} \item файл \mbox{\hyperlink{_account_8java}{Account.\+java}} \item файл \mbox{\hyperlink{_account_type_8java}{Account\+Type.\+java}} \item файл \mbox{\hyperlink{_day_8java}{Day.\+java}} \item файл \mbox{\hyperlink{_group_8java}{Group.\+java}} \item файл \mbox{\hyperlink{_group_material_8java}{Group\+Material.\+java}} \item файл \mbox{\hyperlink{_group_teacher_8java}{Group\+Teacher.\+java}} \item файл \mbox{\hyperlink{_pair_8java}{Pair.\+java}} \item файл \mbox{\hyperlink{_role_8java}{Role.\+java}} \item файл \mbox{\hyperlink{_schedule_8java}{Schedule.\+java}} \item файл \mbox{\hyperlink{_schedule_record_8java}{Schedule\+Record.\+java}} \item файл \mbox{\hyperlink{_student_8java}{Student.\+java}} \item файл \mbox{\hyperlink{_student_material_8java}{Student\+Material.\+java}} \item файл \mbox{\hyperlink{_subject_8java}{Subject.\+java}} \item файл \mbox{\hyperlink{_teacher_8java}{Teacher.\+java}} \item файл \mbox{\hyperlink{_teacher_subject_8java}{Teacher\+Subject.\+java}} \item файл \mbox{\hyperlink{_traffic_8java}{Traffic.\+java}} \end{DoxyCompactItemize} ======================= File: code_doc/latex/_pair_8java.tex ======================= <reponame>vgtstptlk/StudyHelper_REST_API \hypertarget{_pair_8java}{}\doxysection{Файл /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/domain/\+Pair.java} \label{_pair_8java}\index{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/domain/Pair.java@{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/domain/Pair.java}} \doxysubsection*{Классы} \begin{DoxyCompactItemize} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_pair}{crutchesbicycles.\+studyhelper.\+domain.\+Pair}} \end{DoxyCompactItemize} \doxysubsection*{Пакеты} \begin{DoxyCompactItemize} \item package \mbox{\hyperlink{namespacecrutchesbicycles_1_1studyhelper_1_1domain}{crutchesbicycles.\+studyhelper.\+domain}} \end{DoxyCompactItemize} ======================= File: code_doc/latex/_group_8java.tex ======================= <reponame>vgtstptlk/StudyHelper_REST_API \hypertarget{_group_8java}{}\doxysection{Файл /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/domain/\+Group.java} \label{_group_8java}\index{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/domain/Group.java@{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/domain/Group.java}} \doxysubsection*{Классы} \begin{DoxyCompactItemize} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group}{crutchesbicycles.\+studyhelper.\+domain.\+Group}} \end{DoxyCompactItemize} \doxysubsection*{Пакеты} \begin{DoxyCompactItemize} \item package \mbox{\hyperlink{namespacecrutchesbicycles_1_1studyhelper_1_1domain}{crutchesbicycles.\+studyhelper.\+domain}} \end{DoxyCompactItemize} ======================= File: code_doc/latex/namespacecrutchesbicycles_1_1studyhelper_1_1domain.tex ======================= \hypertarget{namespacecrutchesbicycles_1_1studyhelper_1_1domain}{}\doxysection{Пакет crutchesbicycles.\+studyhelper.\+domain} \label{namespacecrutchesbicycles_1_1studyhelper_1_1domain}\index{crutchesbicycles.studyhelper.domain@{crutchesbicycles.studyhelper.domain}} \doxysubsection*{Классы} \begin{DoxyCompactItemize} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account}{Account}} \item enum \mbox{\hyperlink{enumcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_type}{Account\+Type}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_day}{Day}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group}{Group}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material}{Group\+Material}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_teacher}{Group\+Teacher}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_pair}{Pair}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role}{Role}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule}{Schedule}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record}{Schedule\+Record}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student}{Student}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material}{Student\+Material}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_teacher}{Teacher}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_teacher_subject}{Teacher\+Subject}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_traffic}{Traffic}} \end{DoxyCompactItemize} ======================= File: code_doc/latex/classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_configurer.tex ======================= <filename>code_doc/latex/classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_configurer.tex \hypertarget{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_configurer}{}\doxysection{Класс crutchesbicycles.\+studyhelper.\+security.\+jwt.\+Jwt\+Configurer} \label{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_configurer}\index{crutchesbicycles.studyhelper.security.jwt.JwtConfigurer@{crutchesbicycles.studyhelper.security.jwt.JwtConfigurer}} Граф наследования\+:crutchesbicycles.\+studyhelper.\+security.\+jwt.\+Jwt\+Configurer\+:\begin{figure}[H] \begin{center} \leavevmode \includegraphics[height=1.588652cm]{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_configurer} \end{center} \end{figure} \doxysubsection*{Открытые члены} \begin{DoxyCompactItemize} \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_configurer_a0d69c24e19f6e997bf00282411d8329e}{configure}} (Http\+Security http\+Security) throws Exception \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_configurer_ab9301e1f711e885e1fdf020c961bd2e4}{Jwt\+Configurer}} (\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_token_provider}{Jwt\+Token\+Provider}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_configurer_a69fe26d49a7f580e729820973f3f055a}{jwt\+Token\+Provider}}) \end{DoxyCompactItemize} \doxysubsection*{Закрытые данные} \begin{DoxyCompactItemize} \item final \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_token_provider}{Jwt\+Token\+Provider}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_configurer_a69fe26d49a7f580e729820973f3f055a}{jwt\+Token\+Provider}} \end{DoxyCompactItemize} \doxysubsection{Конструктор(ы)} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_configurer_ab9301e1f711e885e1fdf020c961bd2e4}\label{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_configurer_ab9301e1f711e885e1fdf020c961bd2e4}} \index{crutchesbicycles.studyhelper.security.jwt.JwtConfigurer@{crutchesbicycles.studyhelper.security.jwt.JwtConfigurer}!JwtConfigurer@{JwtConfigurer}} \index{JwtConfigurer@{JwtConfigurer}!crutchesbicycles.studyhelper.security.jwt.JwtConfigurer@{crutchesbicycles.studyhelper.security.jwt.JwtConfigurer}} \doxysubsubsection{\texorpdfstring{JwtConfigurer()}{JwtConfigurer()}} {\footnotesize\ttfamily crutchesbicycles.\+studyhelper.\+security.\+jwt.\+Jwt\+Configurer.\+Jwt\+Configurer (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_token_provider}{Jwt\+Token\+Provider}}}]{jwt\+Token\+Provider }\end{DoxyParamCaption})} \doxysubsection{Методы} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_configurer_a0d69c24e19f6e997bf00282411d8329e}\label{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_configurer_a0d69c24e19f6e997bf00282411d8329e}} \index{crutchesbicycles.studyhelper.security.jwt.JwtConfigurer@{crutchesbicycles.studyhelper.security.jwt.JwtConfigurer}!configure@{configure}} \index{configure@{configure}!crutchesbicycles.studyhelper.security.jwt.JwtConfigurer@{crutchesbicycles.studyhelper.security.jwt.JwtConfigurer}} \doxysubsubsection{\texorpdfstring{configure()}{configure()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+security.\+jwt.\+Jwt\+Configurer.\+configure (\begin{DoxyParamCaption}\item[{Http\+Security}]{http\+Security }\end{DoxyParamCaption}) throws Exception} \doxysubsection{Данные класса} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_configurer_a69fe26d49a7f580e729820973f3f055a}\label{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_configurer_a69fe26d49a7f580e729820973f3f055a}} \index{crutchesbicycles.studyhelper.security.jwt.JwtConfigurer@{crutchesbicycles.studyhelper.security.jwt.JwtConfigurer}!jwtTokenProvider@{jwtTokenProvider}} \index{jwtTokenProvider@{jwtTokenProvider}!crutchesbicycles.studyhelper.security.jwt.JwtConfigurer@{crutchesbicycles.studyhelper.security.jwt.JwtConfigurer}} \doxysubsubsection{\texorpdfstring{jwtTokenProvider}{jwtTokenProvider}} {\footnotesize\ttfamily final \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_token_provider}{Jwt\+Token\+Provider}} crutchesbicycles.\+studyhelper.\+security.\+jwt.\+Jwt\+Configurer.\+jwt\+Token\+Provider\hspace{0.3cm}{\ttfamily [private]}} Объявления и описания членов класса находятся в файле\+:\begin{DoxyCompactItemize} \item /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/security/jwt/\mbox{\hyperlink{_jwt_configurer_8java}{Jwt\+Configurer.\+java}}\end{DoxyCompactItemize} ======================= File: code_doc/latex/classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service.tex ======================= <filename>code_doc/latex/classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service.tex \hypertarget{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service}{}\doxysection{Класс crutchesbicycles.\+studyhelper.\+service.\+User\+Service} \label{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service}\index{crutchesbicycles.studyhelper.service.UserService@{crutchesbicycles.studyhelper.service.UserService}} \doxysubsection*{Открытые члены} \begin{DoxyCompactItemize} \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account}{Account}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service_a6c83f11103740fee2f1a20ee83e04d55}{register}} (\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account}{Account}} account, int i) \item List$<$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account}{Account}} $>$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service_a418766083b12acc0ad5aa992ac796b0f}{get\+All}} () \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account}{Account}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service_aaf11e743a8bc9429ddefd29663313bcf}{find\+By\+Email}} (String email) \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service_a722d6e68d280070b6ceb83ef1a7b760b}{User\+Service}} (\mbox{\hyperlink{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_account_repository}{Account\+Repository}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service_a71a7ef67fcccc9f206e8a1961ff5134e}{account\+Repository}}, \mbox{\hyperlink{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_role_repository}{Role\+Repository}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service_acb469e13aa1be1e893bdc63ef7b1afdc}{role\+Repository}}, B\+Crypt\+Password\+Encoder \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service_acc52681532279b58c2ed46f333b3b53b}{b\+Crypt\+Password\+Encoder}}) \end{DoxyCompactItemize} \doxysubsection*{Закрытые данные} \begin{DoxyCompactItemize} \item final \mbox{\hyperlink{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_account_repository}{Account\+Repository}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service_a71a7ef67fcccc9f206e8a1961ff5134e}{account\+Repository}} \item final \mbox{\hyperlink{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_role_repository}{Role\+Repository}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service_acb469e13aa1be1e893bdc63ef7b1afdc}{role\+Repository}} \item final B\+Crypt\+Password\+Encoder \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service_acc52681532279b58c2ed46f333b3b53b}{b\+Crypt\+Password\+Encoder}} \end{DoxyCompactItemize} \doxysubsection{Конструктор(ы)} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service_a722d6e68d280070b6ceb83ef1a7b760b}\label{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service_a722d6e68d280070b6ceb83ef1a7b760b}} \index{crutchesbicycles.studyhelper.service.UserService@{crutchesbicycles.studyhelper.service.UserService}!UserService@{UserService}} \index{UserService@{UserService}!crutchesbicycles.studyhelper.service.UserService@{crutchesbicycles.studyhelper.service.UserService}} \doxysubsubsection{\texorpdfstring{UserService()}{UserService()}} {\footnotesize\ttfamily crutchesbicycles.\+studyhelper.\+service.\+User\+Service.\+User\+Service (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_account_repository}{Account\+Repository}}}]{account\+Repository, }\item[{\mbox{\hyperlink{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_role_repository}{Role\+Repository}}}]{role\+Repository, }\item[{B\+Crypt\+Password\+Encoder}]{b\+Crypt\+Password\+Encoder }\end{DoxyParamCaption})} \doxysubsection{Методы} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service_aaf11e743a8bc9429ddefd29663313bcf}\label{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service_aaf11e743a8bc9429ddefd29663313bcf}} \index{crutchesbicycles.studyhelper.service.UserService@{crutchesbicycles.studyhelper.service.UserService}!findByEmail@{findByEmail}} \index{findByEmail@{findByEmail}!crutchesbicycles.studyhelper.service.UserService@{crutchesbicycles.studyhelper.service.UserService}} \doxysubsubsection{\texorpdfstring{findByEmail()}{findByEmail()}} {\footnotesize\ttfamily \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account}{Account}} crutchesbicycles.\+studyhelper.\+service.\+User\+Service.\+find\+By\+Email (\begin{DoxyParamCaption}\item[{String}]{email }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service_a418766083b12acc0ad5aa992ac796b0f}\label{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service_a418766083b12acc0ad5aa992ac796b0f}} \index{crutchesbicycles.studyhelper.service.UserService@{crutchesbicycles.studyhelper.service.UserService}!getAll@{getAll}} \index{getAll@{getAll}!crutchesbicycles.studyhelper.service.UserService@{crutchesbicycles.studyhelper.service.UserService}} \doxysubsubsection{\texorpdfstring{getAll()}{getAll()}} {\footnotesize\ttfamily List$<$\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account}{Account}}$>$ crutchesbicycles.\+studyhelper.\+service.\+User\+Service.\+get\+All (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service_a6c83f11103740fee2f1a20ee83e04d55}\label{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service_a6c83f11103740fee2f1a20ee83e04d55}} \index{crutchesbicycles.studyhelper.service.UserService@{cr<EMAIL>bic<EMAIL>.studyhelper.service.UserService}!register@{register}} \index{register@{register}!crutchesbicycles.studyhelper.service.UserService@{cr<EMAIL>bicycles.studyhelper.service.UserService}} \doxysubsubsection{\texorpdfstring{register()}{register()}} {\footnotesize\ttfamily \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account}{Account}} crutchesbicycles.\+studyhelper.\+service.\+User\+Service.\+register (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account}{Account}}}]{account, }\item[{int}]{i }\end{DoxyParamCaption})} \begin{DoxyParams}{Аргументы} {\em account} & \\ \hline {\em i} & -\/ если занчение 0, то автоматически пользователю назначается роль пользователя если значение 1, то староста+пользователь если 2, то админ+староста+пользователь \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Возвращает} Account \end{DoxyReturn} \doxysubsection{Данные класса} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service_a71a7ef67fcccc9f206e8a1961ff5134e}\label{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service_a71a7ef67fcccc9f206e8a1961ff5134e}} \index{crutchesbicycles.studyhelper.service.UserService@{crutchesbicycles.studyhelper.service.UserService}!accountRepository@{accountRepository}} \index{accountRepository@{accountRepository}!crutchesbicycles.studyhelper.service.UserService@{crutchesbicycles.studyhelper.service.UserService}} \doxysubsubsection{\texorpdfstring{accountRepository}{accountRepository}} {\footnotesize\ttfamily final \mbox{\hyperlink{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_account_repository}{Account\+Repository}} crutchesbicycles.\+studyhelper.\+service.\+User\+Service.\+account\+Repository\hspace{0.3cm}{\ttfamily [private]}} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service_acc52681532279b58c2ed46f333b3b53b}\label{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service_acc52681532279b58c2ed46f333b3b53b}} \index{crutchesbicycles.studyhelper.service.UserService@{crutchesbicycles.studyhelper.service.UserService}!bCryptPasswordEncoder@{bCryptPasswordEncoder}} \index{bCryptPasswordEncoder@{bCryptPasswordEncoder}!crutchesbicycles.studyhelper.service.UserService@{crutchesbicycles.studyhelper.service.UserService}} \doxysubsubsection{\texorpdfstring{bCryptPasswordEncoder}{bCryptPasswordEncoder}} {\footnotesize\ttfamily final B\+Crypt\+Password\+Encoder crutchesbicycles.\+studyhelper.\+service.\+User\+Service.\+b\+Crypt\+Password\+Encoder\hspace{0.3cm}{\ttfamily [private]}} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service_acb469e13aa1be1e893bdc63ef7b1afdc}\label{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service_acb469e13aa1be1e893bdc63ef7b1afdc}} \index{crutchesbicycles.studyhelper.service.UserService@{crutchesbicycles.studyhelper.service.UserService}!roleRepository@{roleRepository}} \index{roleRepository@{roleRepository}!crutchesbicycles.studyhelper.service.UserService@{crutchesbicycles.studyhelper.service.UserService}} \doxysubsubsection{\texorpdfstring{roleRepository}{roleRepository}} {\footnotesize\ttfamily final \mbox{\hyperlink{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_role_repository}{Role\+Repository}} crutchesbicycles.\+studyhelper.\+service.\+User\+Service.\+role\+Repository\hspace{0.3cm}{\ttfamily [private]}} Объявления и описания членов класса находятся в файле\+:\begin{DoxyCompactItemize} \item /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/service/\mbox{\hyperlink{_user_service_8java}{User\+Service.\+java}}\end{DoxyCompactItemize} ======================= File: code_doc/latex/_jwt_token_filter_8java.tex ======================= \hypertarget{_jwt_token_filter_8java}{}\doxysection{Файл /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/security/jwt/\+Jwt\+Token\+Filter.java} \label{_jwt_token_filter_8java}\index{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/security/jwt/JwtTokenFilter.java@{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/security/jwt/JwtTokenFilter.java}} \doxysubsection*{Классы} \begin{DoxyCompactItemize} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_token_filter}{crutchesbicycles.\+studyhelper.\+security.\+jwt.\+Jwt\+Token\+Filter}} \end{DoxyCompactItemize} \doxysubsection*{Пакеты} \begin{DoxyCompactItemize} \item package \mbox{\hyperlink{namespacecrutchesbicycles_1_1studyhelper_1_1security_1_1jwt}{crutchesbicycles.\+studyhelper.\+security.\+jwt}} \end{DoxyCompactItemize} ======================= File: code_doc/latex/classcrutchesbicycles_1_1studyhelper_1_1security_1_1_user_detail_controller.tex ======================= <filename>code_doc/latex/classcrutchesbicycles_1_1studyhelper_1_1security_1_1_user_detail_controller.tex \hypertarget{classcrutchesbicycles_1_1studyhelper_1_1security_1_1_user_detail_controller}{}\doxysection{Класс crutchesbicycles.\+studyhelper.\+security.\+User\+Detail\+Controller} \label{classcrutchesbicycles_1_1studyhelper_1_1security_1_1_user_detail_controller}\index{crutchesbicycles.studyhelper.security.UserDetailController@{crutchesbicycles.studyhelper.security.UserDetailController}} Граф наследования\+:crutchesbicycles.\+studyhelper.\+security.\+User\+Detail\+Controller\+:\begin{figure}[H] \begin{center} \leavevmode \includegraphics[height=2.000000cm]{classcrutchesbicycles_1_1studyhelper_1_1security_1_1_user_detail_controller} \end{center} \end{figure} \doxysubsection*{Открытые члены} \begin{DoxyCompactItemize} \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_user}{Jwt\+User}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1security_1_1_user_detail_controller_a7efaa737fccc15103966c3155d871b66}{load\+User\+By\+Username}} (String email) throws Username\+Not\+Found\+Exception \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1security_1_1_user_detail_controller_ad7b8356880957a387fb6a017ddaf9118}{User\+Detail\+Controller}} (\mbox{\hyperlink{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_account_repository}{Account\+Repository}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1security_1_1_user_detail_controller_af8d4eb2dbbf5a60a2ab7222458119e1e}{account\+Repository}}) \end{DoxyCompactItemize} \doxysubsection*{Закрытые данные} \begin{DoxyCompactItemize} \item final \mbox{\hyperlink{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_account_repository}{Account\+Repository}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1security_1_1_user_detail_controller_af8d4eb2dbbf5a60a2ab7222458119e1e}{account\+Repository}} \end{DoxyCompactItemize} \doxysubsection{Конструктор(ы)} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1security_1_1_user_detail_controller_ad7b8356880957a387fb6a017ddaf9118}\label{classcrutchesbicycles_1_1studyhelper_1_1security_1_1_user_detail_controller_ad7b8356880957a387fb6a017ddaf9118}} \index{crutchesbicycles.studyhelper.security.UserDetailController@{crutchesbicycles.studyhelper.security.UserDetailController}!UserDetailController@{UserDetailController}} \index{UserDetailController@{UserDetailController}!crutchesbicycles.studyhelper.security.UserDetailController@{crutchesbicycles.studyhelper.security.UserDetailController}} \doxysubsubsection{\texorpdfstring{UserDetailController()}{UserDetailController()}} {\footnotesize\ttfamily crutchesbicycles.\+studyhelper.\+security.\+User\+Detail\+Controller.\+User\+Detail\+Controller (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_account_repository}{Account\+Repository}}}]{account\+Repository }\end{DoxyParamCaption})} \doxysubsection{Методы} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1security_1_1_user_detail_controller_a7efaa737fccc15103966c3155d871b66}\label{classcrutchesbicycles_1_1studyhelper_1_1security_1_1_user_detail_controller_a7efaa737fccc15103966c3155d871b66}} \index{crutchesbicycles.studyhelper.security.UserDetailController@{crutchesbicycles.studyhelper.security.UserDetailController}!loadUserByUsername@{loadUserByUsername}} \index{loadUserByUsername@{loadUserByUsername}!crutchesbicycles.studyhelper.security.UserDetailController@{crutchesbicycles.studyhelper.security.UserDetailController}} \doxysubsubsection{\texorpdfstring{loadUserByUsername()}{loadUserByUsername()}} {\footnotesize\ttfamily \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_user}{Jwt\+User}} crutchesbicycles.\+studyhelper.\+security.\+User\+Detail\+Controller.\+load\+User\+By\+Username (\begin{DoxyParamCaption}\item[{String}]{email }\end{DoxyParamCaption}) throws Username\+Not\+Found\+Exception} \doxysubsection{Данные класса} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1security_1_1_user_detail_controller_af8d4eb2dbbf5a60a2ab7222458119e1e}\label{classcrutchesbicycles_1_1studyhelper_1_1security_1_1_user_detail_controller_af8d4eb2dbbf5a60a2ab7222458119e1e}} \index{crutchesbicycles.studyhelper.security.UserDetailController@{crutchesbicycles.studyhelper.security.UserDetailController}!accountRepository@{accountRepository}} \index{accountRepository@{accountRepository}!crutchesbicycles.studyhelper.security.UserDetailController@{crutchesbicycles.studyhelper.security.UserDetailController}} \doxysubsubsection{\texorpdfstring{accountRepository}{accountRepository}} {\footnotesize\ttfamily final \mbox{\hyperlink{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_account_repository}{Account\+Repository}} crutchesbicycles.\+studyhelper.\+security.\+User\+Detail\+Controller.\+account\+Repository\hspace{0.3cm}{\ttfamily [private]}} Объявления и описания членов класса находятся в файле\+:\begin{DoxyCompactItemize} \item /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/security/\mbox{\hyperlink{_user_detail_controller_8java}{User\+Detail\+Controller.\+java}}\end{DoxyCompactItemize} ======================= File: code_doc/latex/_studyhelper_application_8java.tex ======================= \hypertarget{_studyhelper_application_8java}{}\doxysection{Файл /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/\+Studyhelper\+Application.java} \label{_studyhelper_application_8java}\index{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/StudyhelperApplication.java@{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/StudyhelperApplication.java}} \doxysubsection*{Классы} \begin{DoxyCompactItemize} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_studyhelper_application}{crutchesbicycles.\+studyhelper.\+Studyhelper\+Application}} \end{DoxyCompactItemize} \doxysubsection*{Пакеты} \begin{DoxyCompactItemize} \item package \mbox{\hyperlink{namespacecrutchesbicycles_1_1studyhelper}{crutchesbicycles.\+studyhelper}} \end{DoxyCompactItemize} ======================= File: code_doc/latex/classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_student_not_found_exception.tex ======================= \hypertarget{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_student_not_found_exception}{}\doxysection{Класс crutchesbicycles.\+studyhelper.\+exception.\+Student\+Not\+Found\+Exception} \label{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_student_not_found_exception}\index{crutchesbicycles.studyhelper.exception.StudentNotFoundException@{crutchesbicycles.studyhelper.exception.StudentNotFoundException}} Граф наследования\+:crutchesbicycles.\+studyhelper.\+exception.\+Student\+Not\+Found\+Exception\+:\begin{figure}[H] \begin{center} \leavevmode \includegraphics[height=2.000000cm]{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_student_not_found_exception} \end{center} \end{figure} \doxysubsection*{Открытые члены} \begin{DoxyCompactItemize} \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_student_not_found_exception_a06be8c8fa2a48edef045d7f824184892}{Student\+Not\+Found\+Exception}} (String id\+Student) \end{DoxyCompactItemize} \doxysubsection{Конструктор(ы)} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_student_not_found_exception_a06be8c8fa2a48edef045d7f824184892}\label{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_student_not_found_exception_a06be8c8fa2a48edef045d7f824184892}} \index{crutchesbicycles.studyhelper.exception.StudentNotFoundException@{crutchesbicycles.studyhelper.exception.StudentNotFoundException}!StudentNotFoundException@{StudentNotFoundException}} \index{StudentNotFoundException@{StudentNotFoundException}!crutchesbicycles.studyhelper.exception.StudentNotFoundException@{crutchesbicycles.studyhelper.exception.StudentNotFoundException}} \doxysubsubsection{\texorpdfstring{StudentNotFoundException()}{StudentNotFoundException()}} {\footnotesize\ttfamily crutchesbicycles.\+studyhelper.\+exception.\+Student\+Not\+Found\+Exception.\+Student\+Not\+Found\+Exception (\begin{DoxyParamCaption}\item[{String}]{id\+Student }\end{DoxyParamCaption})} Объявления и описания членов класса находятся в файле\+:\begin{DoxyCompactItemize} \item /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/exception/\mbox{\hyperlink{_student_not_found_exception_8java}{Student\+Not\+Found\+Exception.\+java}}\end{DoxyCompactItemize} ======================= File: code_doc/latex/namespacecrutchesbicycles_1_1studyhelper.tex ======================= \hypertarget{namespacecrutchesbicycles_1_1studyhelper}{}\doxysection{Пакет crutchesbicycles.\+studyhelper} \label{namespacecrutchesbicycles_1_1studyhelper}\index{crutchesbicycles.studyhelper@{crutchesbicycles.studyhelper}} \doxysubsection*{Пакеты} \begin{DoxyCompactItemize} \item package \mbox{\hyperlink{namespacecrutchesbicycles_1_1studyhelper_1_1config}{config}} \item package \mbox{\hyperlink{namespacecrutchesbicycles_1_1studyhelper_1_1controller}{controller}} \item package \mbox{\hyperlink{namespacecrutchesbicycles_1_1studyhelper_1_1domain}{domain}} \item package \mbox{\hyperlink{namespacecrutchesbicycles_1_1studyhelper_1_1exception}{exception}} \item package \mbox{\hyperlink{namespacecrutchesbicycles_1_1studyhelper_1_1repos}{repos}} \item package \mbox{\hyperlink{namespacecrutchesbicycles_1_1studyhelper_1_1security}{security}} \item package \mbox{\hyperlink{namespacecrutchesbicycles_1_1studyhelper_1_1service}{service}} \end{DoxyCompactItemize} \doxysubsection*{Классы} \begin{DoxyCompactItemize} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_account_controller_test}{Account\+Controller\+Test}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_file_upload_controller_test}{File\+Upload\+Controller\+Test}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_group_controller_test}{Group\+Controller\+Test}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_group_material_controller_test}{Group\+Material\+Controller\+Test}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_student_controller_test}{Student\+Controller\+Test}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_student_material_controller_test}{Student\+Material\+Controller\+Test}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_studyhelper_application}{Studyhelper\+Application}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_studyhelper_application_tests}{Studyhelper\+Application\+Tests}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_subject_controller_test}{Subject\+Controller\+Test}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test}{Teacher\+Controller\+Test}} \end{DoxyCompactItemize} ======================= File: code_doc/latex/hierarchy.tex ======================= \doxysection{Иерархия классов} Иерархия классов.\begin{DoxyCompactList} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+controller.\+Account\+Controller}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_account_controller}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+Account\+Controller\+Test}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1_account_controller_test}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+domain.\+Account\+Type}{\pageref{enumcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_type}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+repos.\+Account\+Type\+Repository}{\pageref{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_account_type_repository}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+controller.\+Auth\+Controller}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_auth_controller}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+controller.\+File\+Upload\+Controller}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_file_upload_controller}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+File\+Upload\+Controller\+Test}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1_file_upload_controller_test}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+controller.\+Group\+Controller}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_group_controller}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+Group\+Controller\+Test}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1_group_controller_test}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+controller.\+Group\+Material\+Controller}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_group_material_controller}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+Group\+Material\+Controller\+Test}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1_group_material_controller_test}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+security.\+jwt.\+Jwt\+Token\+Provider}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_token_provider}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+security.\+jwt.\+Jwt\+User\+Factory}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_user_factory}}{} \item Runtime\+Exception\begin{DoxyCompactList} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+exception.\+Account\+Exists\+Exception}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_account_exists_exception}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+exception.\+Account\+Not\+Found\+Exception}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_account_not_found_exception}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+exception.\+Day\+Not\+Found\+Exception}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_day_not_found_exception}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+exception.\+Group\+Exists\+Exception}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_group_exists_exception}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+exception.\+Group\+Material\+Not\+Found\+Exception}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_group_material_not_found_exception}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+exception.\+Group\+Not\+Found\+Exception}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_group_not_found_exception}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+exception.\+Group\+Teacher\+Not\+Found\+Exception}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_group_teacher_not_found_exception}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+exception.\+Schedule\+Record\+Not\+Found\+Exception}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_schedule_record_not_found_exception}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+exception.\+Student\+Material\+Not\+Found\+Exception}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_student_material_not_found_exception}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+exception.\+Student\+Not\+Found\+Exception}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_student_not_found_exception}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+exception.\+Subject\+Exist\+Exception}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_subject_exist_exception}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+exception.\+Subject\+Not\+Found\+Exception}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_subject_not_found_exception}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+exception.\+Teacher\+Exists\+Exception}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_teacher_exists_exception}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+exception.\+Teacher\+Not\+Found\+Exception}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_teacher_not_found_exception}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+exception.\+Teacher\+Subject\+Not\+Found}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_teacher_subject_not_found}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+exception.\+Traffic\+Not\+Found\+Exception}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_traffic_not_found_exception}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+exception.\+User\+Not\+Found\+Exception}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_user_not_found_exception}}{} \end{DoxyCompactList} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+controller.\+Schedule\+Controller}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_schedule_controller}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+controller.\+Student\+Controller}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_student_controller}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+Student\+Controller\+Test}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1_student_controller_test}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+controller.\+Student\+Material\+Controller}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_student_material_controller}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+Student\+Material\+Controller\+Test}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1_student_material_controller_test}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+Studyhelper\+Application}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1_studyhelper_application}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+Studyhelper\+Application\+Tests}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1_studyhelper_application_tests}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+controller.\+Subject\+Controller}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_subject_controller}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+Subject\+Controller\+Test}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1_subject_controller_test}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+controller.\+Teacher\+Controller}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_teacher_controller}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+Teacher\+Controller\+Test}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1_teacher_controller_test}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+controller.\+Traffic\+Controller}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_traffic_controller}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+service.\+User\+Service}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1service_1_1_user_service}}{} \item Authentication\+Exception\begin{DoxyCompactList} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+security.\+jwt.\+Jwt\+Authentication\+Exception}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_authentication_exception}}{} \end{DoxyCompactList} \item Generic\+Filter\+Bean\begin{DoxyCompactList} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+security.\+jwt.\+Jwt\+Token\+Filter}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_token_filter}}{} \end{DoxyCompactList} \item Jpa\+Repository\begin{DoxyCompactList} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+repos.\+Account\+Repository}{\pageref{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_account_repository}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+repos.\+Day\+Repository}{\pageref{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_day_repository}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+repos.\+Group\+Material\+Repository}{\pageref{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_group_material_repository}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+repos.\+Group\+Repository}{\pageref{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_group_repository}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+repos.\+Group\+Teacher\+Repository}{\pageref{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_group_teacher_repository}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+repos.\+Role\+Repository}{\pageref{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_role_repository}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+repos.\+Schedule\+Record\+Repository}{\pageref{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_schedule_record_repository}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+repos.\+Schedule\+Repository}{\pageref{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_schedule_repository}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+repos.\+Student\+Material\+Repository}{\pageref{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_student_material_repository}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+repos.\+Student\+Repository}{\pageref{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_student_repository}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+repos.\+Subject\+Repository}{\pageref{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_subject_repository}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+repos.\+Teacher\+Repository}{\pageref{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_teacher_repository}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+repos.\+Teacher\+Subject\+Repository}{\pageref{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_teacher_subject_repository}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+repos.\+Traffic\+Repository}{\pageref{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_traffic_repository}}{} \end{DoxyCompactList} \item Security\+Configurer\+Adapter\begin{DoxyCompactList} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+security.\+jwt.\+Jwt\+Configurer}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_configurer}}{} \end{DoxyCompactList} \item Serializable\begin{DoxyCompactList} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+domain.\+Account}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+domain.\+Day}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_day}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+domain.\+Group}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+domain.\+Group\+Material}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+domain.\+Group\+Teacher}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_teacher}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+domain.\+Pair}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_pair}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+domain.\+Role}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+domain.\+Schedule}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+domain.\+Schedule\+Record}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+domain.\+Student}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+domain.\+Student\+Material}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+domain.\+Subject}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+domain.\+Teacher}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_teacher}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+domain.\+Teacher\+Subject}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_teacher_subject}}{} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+domain.\+Traffic}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_traffic}}{} \end{DoxyCompactList} \item User\+Details\begin{DoxyCompactList} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+security.\+jwt.\+Jwt\+User}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_user}}{} \end{DoxyCompactList} \item User\+Details\+Service\begin{DoxyCompactList} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+security.\+User\+Detail\+Controller}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1security_1_1_user_detail_controller}}{} \end{DoxyCompactList} \item Web\+Security\+Configurer\+Adapter\begin{DoxyCompactList} \item \contentsline{section}{crutchesbicycles.\+studyhelper.\+config.\+Security\+Config}{\pageref{classcrutchesbicycles_1_1studyhelper_1_1config_1_1_security_config}}{} \end{DoxyCompactList} \end{DoxyCompactList} ======================= File: code_doc/latex/classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_teacher_not_found_exception.tex ======================= <filename>code_doc/latex/classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_teacher_not_found_exception.tex \hypertarget{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_teacher_not_found_exception}{}\doxysection{Класс crutchesbicycles.\+studyhelper.\+exception.\+Teacher\+Not\+Found\+Exception} \label{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_teacher_not_found_exception}\index{crutchesbicycles.studyhelper.exception.TeacherNotFoundException@{crutchesbicycles.studyhelper.exception.TeacherNotFoundException}} Граф наследования\+:crutchesbicycles.\+studyhelper.\+exception.\+Teacher\+Not\+Found\+Exception\+:\begin{figure}[H] \begin{center} \leavevmode \includegraphics[height=2.000000cm]{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_teacher_not_found_exception} \end{center} \end{figure} \doxysubsection*{Открытые члены} \begin{DoxyCompactItemize} \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_teacher_not_found_exception_a073849ad7df137551b887f75344f60ae}{Teacher\+Not\+Found\+Exception}} (String id\+Teacher) \end{DoxyCompactItemize} \doxysubsection{Конструктор(ы)} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_teacher_not_found_exception_a073849ad7df137551b887f75344f60ae}\label{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_teacher_not_found_exception_a073849ad7df137551b887f75344f60ae}} \index{crutchesbicycles.studyhelper.exception.TeacherNotFoundException@{crutchesbicycles.studyhelper.exception.TeacherNotFoundException}!TeacherNotFoundException@{TeacherNotFoundException}} \index{TeacherNotFoundException@{TeacherNotFoundException}!crutchesbicycles.studyhelper.exception.TeacherNotFoundException@{crutchesbicycles.studyhelper.exception.TeacherNotFoundException}} \doxysubsubsection{\texorpdfstring{TeacherNotFoundException()}{TeacherNotFoundException()}} {\footnotesize\ttfamily crutchesbicycles.\+studyhelper.\+exception.\+Teacher\+Not\+Found\+Exception.\+Teacher\+Not\+Found\+Exception (\begin{DoxyParamCaption}\item[{String}]{id\+Teacher }\end{DoxyParamCaption})} Объявления и описания членов класса находятся в файле\+:\begin{DoxyCompactItemize} \item /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/exception/\mbox{\hyperlink{_teacher_not_found_exception_8java}{Teacher\+Not\+Found\+Exception.\+java}}\end{DoxyCompactItemize} ======================= File: code_doc/latex/_schedule_record_8java.tex ======================= <reponame>vgtstptlk/StudyHelper_REST_API \hypertarget{_schedule_record_8java}{}\doxysection{Файл /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/domain/\+Schedule\+Record.java} \label{_schedule_record_8java}\index{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/domain/ScheduleRecord.java@{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/domain/ScheduleRecord.java}} \doxysubsection*{Классы} \begin{DoxyCompactItemize} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record}{crutchesbicycles.\+studyhelper.\+domain.\+Schedule\+Record}} \end{DoxyCompactItemize} \doxysubsection*{Пакеты} \begin{DoxyCompactItemize} \item package \mbox{\hyperlink{namespacecrutchesbicycles_1_1studyhelper_1_1domain}{crutchesbicycles.\+studyhelper.\+domain}} \end{DoxyCompactItemize} ======================= File: code_doc/latex/dir_68267d1309a1af8e8297ef4c3efbcdba.tex ======================= <reponame>vgtstptlk/StudyHelper_REST_API<gh_stars>0 \hypertarget{dir_68267d1309a1af8e8297ef4c3efbcdba}{}\doxysection{Содержание директории /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src} \label{dir_68267d1309a1af8e8297ef4c3efbcdba}\index{Содержание директории /Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src@{Содержание директории /Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src}} \doxysubsection*{Директории} \begin{DoxyCompactItemize} \item директория \mbox{\hyperlink{dir_5eb159725f84c66aafd839904a4acdd0}{main}} \item директория \mbox{\hyperlink{dir_120ed4da3e3217b1e7fc0b4f48568e79}{test}} \end{DoxyCompactItemize} ======================= File: code_doc/latex/classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role.tex ======================= <reponame>vgtstptlk/StudyHelper_REST_API \hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role}{}\doxysection{Класс crutchesbicycles.\+studyhelper.\+domain.\+Role} \label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role}\index{crutchesbicycles.studyhelper.domain.Role@{crutchesbicycles.studyhelper.domain.Role}} Граф наследования\+:crutchesbicycles.\+studyhelper.\+domain.\+Role\+:\begin{figure}[H] \begin{center} \leavevmode \includegraphics[height=2.000000cm]{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role} \end{center} \end{figure} \doxysubsection*{Открытые члены} \begin{DoxyCompactItemize} \item Long \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_aca271d9ca97ed7123dadb7529ce1826c}{get\+Id}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_adf1996c81eb7a0fe1db4f6f24dd858a2}{set\+Id}} (Long \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_aacc494d4f9153cb887d21f881027513f}{id}}) \item String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_afebd9093dbbb593010f62a0ee357e3b9}{get\+Name}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_a50a613bdbdc14b402556814268b53cfa}{set\+Name}} (String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_ad05607466427c80f9f708a949641adb2}{name}}) \item List$<$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account}{Account}} $>$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_ace5c5535ab5bb6fc1a49879b1fde91c3}{get\+Accounts}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_a84ad3b69c6d95a1a0c720ecb7b8087a6}{set\+Accounts}} (List$<$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account}{Account}} $>$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_a805ba049031e42339c13012855d33180}{accounts}}) \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_a0c5b1ba70058fa027289fd70936ca423}{Role}} () \end{DoxyCompactItemize} \doxysubsection*{Закрытые данные} \begin{DoxyCompactItemize} \item Long \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_aacc494d4f9153cb887d21f881027513f}{id}} \item String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_ad05607466427c80f9f708a949641adb2}{name}} \item List$<$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account}{Account}} $>$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_a805ba049031e42339c13012855d33180}{accounts}} \end{DoxyCompactItemize} \doxysubsection{Конструктор(ы)} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_a0c5b1ba70058fa027289fd70936ca423}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_a0c5b1ba70058fa027289fd70936ca423}} \index{crutchesbicycles.studyhelper.domain.Role@{crutchesbicycles.studyhelper.domain.Role}!Role@{Role}} \index{Role@{Role}!crutchesbicycles.studyhelper.domain.Role@{crutchesbicycles.studyhelper.domain.Role}} \doxysubsubsection{\texorpdfstring{Role()}{Role()}} {\footnotesize\ttfamily crutchesbicycles.\+studyhelper.\+domain.\+Role.\+Role (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} \doxysubsection{Методы} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_ace5c5535ab5bb6fc1a49879b1fde91c3}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_ace5c5535ab5bb6fc1a49879b1fde91c3}} \index{crutchesbicycles.studyhelper.domain.Role@{crutchesbicycles.studyhelper.domain.Role}!getAccounts@{getAccounts}} \index{getAccounts@{getAccounts}!crutchesbicycles.studyhelper.domain.Role@{crutchesbicycles.studyhelper.domain.Role}} \doxysubsubsection{\texorpdfstring{getAccounts()}{getAccounts()}} {\footnotesize\ttfamily List$<$\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account}{Account}}$>$ crutchesbicycles.\+studyhelper.\+domain.\+Role.\+get\+Accounts (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_aca271d9ca97ed7123dadb7529ce1826c}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_aca271d9ca97ed7123dadb7529ce1826c}} \index{crutchesbicycles.studyhelper.domain.Role@{crutchesbicycles.studyhelper.domain.Role}!getId@{getId}} \index{getId@{getId}!crutchesbicycles.studyhelper.domain.Role@{crutchesbicycles.studyhelper.domain.Role}} \doxysubsubsection{\texorpdfstring{getId()}{getId()}} {\footnotesize\ttfamily Long crutchesbicycles.\+studyhelper.\+domain.\+Role.\+get\+Id (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_afebd9093dbbb593010f62a0ee357e3b9}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_afebd9093dbbb593010f62a0ee357e3b9}} \index{crutchesbicycles.studyhelper.domain.Role@{crutchesbicycles.studyhelper.domain.Role}!getName@{getName}} \index{getName@{getName}!crutchesbicycles.studyhelper.domain.Role@{crutchesbicycles.studyhelper.domain.Role}} \doxysubsubsection{\texorpdfstring{getName()}{getName()}} {\footnotesize\ttfamily String crutchesbicycles.\+studyhelper.\+domain.\+Role.\+get\+Name (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_a84ad3b69c6d95a1a0c720ecb7b8087a6}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_a84ad3b69c6d95a1a0c720ecb7b8087a6}} \index{crutchesbicycles.studyhelper.domain.Role@{crutchesbicycles.studyhelper.domain.Role}!setAccounts@{setAccounts}} \index{setAccounts@{setAccounts}!crutchesbicycles.studyhelper.domain.Role@{crutchesbicycles.studyhelper.domain.Role}} \doxysubsubsection{\texorpdfstring{setAccounts()}{setAccounts()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+domain.\+Role.\+set\+Accounts (\begin{DoxyParamCaption}\item[{List$<$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account}{Account}} $>$}]{accounts }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_adf1996c81eb7a0fe1db4f6f24dd858a2}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_adf1996c81eb7a0fe1db4f6f24dd858a2}} \index{crutchesbicycles.studyhelper.domain.Role@{crutchesbicycles.studyhelper.domain.Role}!setId@{setId}} \index{setId@{setId}!crutchesbicycles.studyhelper.domain.Role@{crutchesbicycles.studyhelper.domain.Role}} \doxysubsubsection{\texorpdfstring{setId()}{setId()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+domain.\+Role.\+set\+Id (\begin{DoxyParamCaption}\item[{Long}]{id }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_a50a613bdbdc14b402556814268b53cfa}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_a50a613bdbdc14b402556814268b53cfa}} \index{crutchesbicycles.studyhelper.domain.Role@{crutchesbicycles.studyhelper.domain.Role}!setName@{setName}} \index{setName@{setName}!crutchesbicycles.studyhelper.domain.Role@{crutchesbicycles.studyhelper.domain.Role}} \doxysubsubsection{\texorpdfstring{setName()}{setName()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+domain.\+Role.\+set\+Name (\begin{DoxyParamCaption}\item[{String}]{name }\end{DoxyParamCaption})} \doxysubsection{Данные класса} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_a805ba049031e42339c13012855d33180}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_a805ba049031e42339c13012855d33180}} \index{crutchesbicycles.studyhelper.domain.Role@{crutchesbicycles.studyhelper.domain.Role}!accounts@{accounts}} \index{accounts@{accounts}!crutchesbicycles.studyhelper.domain.Role@{crutchesbicycles.studyhelper.domain.Role}} \doxysubsubsection{\texorpdfstring{accounts}{accounts}} {\footnotesize\ttfamily List$<$\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account}{Account}}$>$ crutchesbicycles.\+studyhelper.\+domain.\+Role.\+accounts\hspace{0.3cm}{\ttfamily [private]}} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_aacc494d4f9153cb887d21f881027513f}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_aacc494d4f9153cb887d21f881027513f}} \index{crutchesbicycles.studyhelper.domain.Role@{crutchesbicycles.studyhelper.domain.Role}!id@{id}} \index{id@{id}!crutchesbicycles.studyhelper.domain.Role@{crutchesbicycles.studyhelper.domain.Role}} \doxysubsubsection{\texorpdfstring{id}{id}} {\footnotesize\ttfamily Long crutchesbicycles.\+studyhelper.\+domain.\+Role.\+id\hspace{0.3cm}{\ttfamily [private]}} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_ad05607466427c80f9f708a949641adb2}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role_ad05607466427c80f9f708a949641adb2}} \index{crutchesbicycles.studyhelper.domain.Role@{crutchesbicycles.studyhelper.domain.Role}!name@{name}} \index{name@{name}!crutchesbicycles.studyhelper.domain.Role@{crutchesbicycles.studyhelper.domain.Role}} \doxysubsubsection{\texorpdfstring{name}{name}} {\footnotesize\ttfamily String crutchesbicycles.\+studyhelper.\+domain.\+Role.\+name\hspace{0.3cm}{\ttfamily [private]}} Объявления и описания членов класса находятся в файле\+:\begin{DoxyCompactItemize} \item /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/domain/\mbox{\hyperlink{_role_8java}{Role.\+java}}\end{DoxyCompactItemize} ======================= File: code_doc/latex/classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account.tex ======================= <filename>code_doc/latex/classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account.tex \hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account}{}\doxysection{Класс crutchesbicycles.\+studyhelper.\+domain.\+Account} \label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account}\index{crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}} Граф наследования\+:crutchesbicycles.\+studyhelper.\+domain.\+Account\+:\begin{figure}[H] \begin{center} \leavevmode \includegraphics[height=2.000000cm]{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account} \end{center} \end{figure} \doxysubsection*{Открытые члены} \begin{DoxyCompactItemize} \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_abf3b6c56d82847b4cfcdd3df9dafcbd0}{Account}} () \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a7229e6072da173223f228f5eb92cc644}{Account}} (\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student}{Student}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_ab167051fab06a14cee2c9af96c049393}{student}}, String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a82d572f86531abcba965fc2351ca98b2}{email}}, String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_af063fb29616eb9077c5884fb4b0625b4}{password}}, List$<$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role}{Role}} $>$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a481e5dd3488be79ea806d2186ae0c478}{roles}}) \item long \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a9ccbc5f6b3caff416719f43f3e21db9a}{get\+Id\+Account}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_ab8a12e2b747d025f6fed192df8a445ba}{set\+Id\+Account}} (long \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a0a059935edf9124a0f82af3fb7483719}{id\+Account}}) \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student}{Student}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a0d4cada5c441bb9b6d38e60a3877a5d1}{get\+Student}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_aa43cf25e2f8e951ee738bde66d3a465a}{set\+Student}} (\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student}{Student}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_ab167051fab06a14cee2c9af96c049393}{student}}) \item String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_acd3eb750ccb830f17b7213d14c2b841d}{get\+Email}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a6d86845abf88bbd795ae7b494c7beefb}{set\+Email}} (String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a82d572f86531abcba965fc2351ca98b2}{email}}) \item String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a427462699dd4ce7c270010e06d6433a4}{get\+Password}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_aa17d3c76569bc53a7afc59b5f5e0b73e}{set\+Password}} (String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_af063fb29616eb9077c5884<PASSWORD>}{password}}) \item List$<$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role}{Role}} $>$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_ac13cc34046071b8437a60e010064f41f}{get\+Roles}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a9fc22f32f4f3b0d3f7ef9ebb259a0f67}{set\+Roles}} (List$<$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role}{Role}} $>$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a481e5dd3488be79ea806d2186ae0c478}{roles}}) \end{DoxyCompactItemize} \doxysubsection*{Закрытые данные} \begin{DoxyCompactItemize} \item long \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a0a059935edf9124a0f82af3fb7483719}{id\+Account}} \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student}{Student}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_ab167051fab06a14cee2c9af96c049393}{student}} \item String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a82d572f86531abcba965fc2351ca98b2}{email}} \item String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_af063fb29616eb9077c5884fb4b0625b4}{password}} \item List$<$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role}{Role}} $>$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a481e5dd3488be79ea806d2186ae0c478}{roles}} \end{DoxyCompactItemize} \doxysubsection{Подробное описание} Сущность \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account}{Account}}. Предоставляет основные поля для аккаунта, внезависимости от типа аккаунта.~\newline Расширяет сущность \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student}{Student}}.~\newline Состоит из полей\+:~\newline \begin{DoxyParams}{Аргументы} {\em id\+Account} & -- уникальный id~\newline \\ \hline {\em student} & -- \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student}{Student}} \\ \hline {\em email} & -- почта пользователя \\ \hline {\em password} & -- <PASSWORD> \\ \hline {\em account\+Type} & -- тип аккаунта, может быть как староста, зам старосты и просто студент \\ \hline \end{DoxyParams} \begin{DoxySeeAlso}{См. также} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student}{Student}} \end{DoxySeeAlso} \begin{DoxyAuthor}{Автор} vgtstptlk / <NAME> \end{DoxyAuthor} \begin{DoxyVersion}{Версия} 1.\+0.\+0 \end{DoxyVersion} \doxysubsection{Конструктор(ы)} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_abf3b6c56d82847b4cfcdd3df9dafcbd0}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_abf3b6c56d82847b4cfcdd3df9dafcbd0}} \index{crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}!Account@{Account}} \index{Account@{Account}!crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}} \doxysubsubsection{\texorpdfstring{Account()}{Account()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}} {\footnotesize\ttfamily crutchesbicycles.\+studyhelper.\+domain.\+Account.\+Account (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a7229e6072da173223f228f5eb92cc644}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a7229e6072da173223f228f5eb92cc644}} \index{crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}!Account@{Account}} \index{Account@{Account}!crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}} \doxysubsubsection{\texorpdfstring{Account()}{Account()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}} {\footnotesize\ttfamily crutchesbicycles.\+studyhelper.\+domain.\+Account.\+Account (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student}{Student}}}]{student, }\item[{String}]{email, }\item[{String}]{password, }\item[{List$<$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role}{Role}} $>$}]{roles }\end{DoxyParamCaption})} \doxysubsection{Методы} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_acd3eb750ccb830f17b7213d14c2b841d}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_acd3eb750ccb830f17b7213d14c2b841d}} \index{crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}!getEmail@{getEmail}} \index{getEmail@{getEmail}!crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}} \doxysubsubsection{\texorpdfstring{getEmail()}{getEmail()}} {\footnotesize\ttfamily String crutchesbicycles.\+studyhelper.\+domain.\+Account.\+get\+Email (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a9ccbc5f6b3caff416719f43f3e21db9a}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a9ccbc5f6b3caff416719f43f3e21db9a}} \index{crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}!getIdAccount@{getIdAccount}} \index{getIdAccount@{getIdAccount}!crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}} \doxysubsubsection{\texorpdfstring{getIdAccount()}{getIdAccount()}} {\footnotesize\ttfamily long crutchesbicycles.\+studyhelper.\+domain.\+Account.\+get\+Id\+Account (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a427462699dd4ce7c270010e06d6433a4}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a427462699dd4ce7c270010e06d6433a4}} \index{crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}!getPassword@{getPassword}} \index{getPassword@{getPassword}!crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}} \doxysubsubsection{\texorpdfstring{getPassword()}{getPassword()}} {\footnotesize\ttfamily String crutchesbicycles.\+studyhelper.\+domain.\+Account.\+get\+Password (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_ac13cc34046071b8437a60e010064f41f}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_ac13cc34046071b8437a60e010064f41f}} \index{crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}!getRoles@{getRoles}} \index{getRoles@{getRoles}!crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}} \doxysubsubsection{\texorpdfstring{getRoles()}{getRoles()}} {\footnotesize\ttfamily List$<$\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role}{Role}}$>$ crutchesbicycles.\+studyhelper.\+domain.\+Account.\+get\+Roles (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a0d4cada5c441bb9b6d38e60a3877a5d1}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a0d4cada5c441bb9b6d38e60a3877a5d1}} \index{crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}!getStudent@{getStudent}} \index{getStudent@{getStudent}!crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}} \doxysubsubsection{\texorpdfstring{getStudent()}{getStudent()}} {\footnotesize\ttfamily \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student}{Student}} crutchesbicycles.\+studyhelper.\+domain.\+Account.\+get\+Student (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a6d86845abf88bbd795ae7b494c7beefb}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a6d86845abf88bbd795ae7b494c7beefb}} \index{crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}!setEmail@{setEmail}} \index{setEmail@{setEmail}!crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}} \doxysubsubsection{\texorpdfstring{setEmail()}{setEmail()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+domain.\+Account.\+set\+Email (\begin{DoxyParamCaption}\item[{String}]{email }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_ab8a12e2b747d025f6fed192df8a445ba}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_ab8a12e2b747d025f6fed192df8a445ba}} \index{crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}!setIdAccount@{setIdAccount}} \index{setIdAccount@{setIdAccount}!crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}} \doxysubsubsection{\texorpdfstring{setIdAccount()}{setIdAccount()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+domain.\+Account.\+set\+Id\+Account (\begin{DoxyParamCaption}\item[{long}]{id\+Account }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_aa17d3c76569bc53a7afc59b5f5e0b73e}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_aa17d3c76569bc53a7afc59b5f5e0b73e}} \index{crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}!setPassword@{setPassword}} \index{setPassword@{setPassword}!crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}} \doxysubsubsection{\texorpdfstring{setPassword()}{setPassword()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+domain.\+Account.\+set\+Password (\begin{DoxyParamCaption}\item[{String}]{password }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a9fc22f32f4f3b0d3f7ef9ebb259a0f67}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a9fc22f32f4f3b0d3f7ef9ebb259a0f67}} \index{crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}!setRoles@{setRoles}} \index{setRoles@{setRoles}!crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}} \doxysubsubsection{\texorpdfstring{setRoles()}{setRoles()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+domain.\+Account.\+set\+Roles (\begin{DoxyParamCaption}\item[{List$<$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role}{Role}} $>$}]{roles }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_aa43cf25e2f8e951ee738bde66d3a465a}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_aa43cf25e2f8e951ee738bde66d3a465a}} \index{crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}!setStudent@{setStudent}} \index{setStudent@{setStudent}!crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}} \doxysubsubsection{\texorpdfstring{setStudent()}{setStudent()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+domain.\+Account.\+set\+Student (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student}{Student}}}]{student }\end{DoxyParamCaption})} \doxysubsection{Данные класса} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a82d572f86531abcba965fc2351ca98b2}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a82d572f86531abcba965fc2351ca98b2}} \index{crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}!email@{email}} \index{email@{email}!crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}} \doxysubsubsection{\texorpdfstring{email}{email}} {\footnotesize\ttfamily String crutchesbicycles.\+studyhelper.\+domain.\+Account.\+email\hspace{0.3cm}{\ttfamily [private]}} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a0a059935edf9124a0f82af3fb7483719}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a0a059935edf9124a0f82af3fb7483719}} \index{crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}!idAccount@{idAccount}} \index{idAccount@{idAccount}!crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}} \doxysubsubsection{\texorpdfstring{idAccount}{idAccount}} {\footnotesize\ttfamily long crutchesbicycles.\+studyhelper.\+domain.\+Account.\+id\+Account\hspace{0.3cm}{\ttfamily [private]}} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_af063fb29616eb9077c5884fb4b0625b4}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_af063fb29616eb9077c5884fb4b0625b4}} \index{crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}!password@{password}} \index{password@{password}!crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}} \doxysubsubsection{\texorpdfstring{password}{password}} {\footnotesize\ttfamily String crutchesbicycles.\+studyhelper.\+domain.\+Account.\+password\hspace{0.3cm}{\ttfamily [private]}} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a481e5dd3488be79ea806d2186ae0c478}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_a481e5dd3488be79ea806d2186ae0c478}} \index{crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}!roles@{roles}} \index{roles@{roles}!crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}} \doxysubsubsection{\texorpdfstring{roles}{roles}} {\footnotesize\ttfamily List$<$\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_role}{Role}}$>$ crutchesbicycles.\+studyhelper.\+domain.\+Account.\+roles\hspace{0.3cm}{\ttfamily [private]}} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_ab167051fab06a14cee2c9af96c049393}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_account_ab167051fab06a14cee2c9af96c049393}} \index{crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}!student@{student}} \index{student@{student}!crutchesbicycles.studyhelper.domain.Account@{crutchesbicycles.studyhelper.domain.Account}} \doxysubsubsection{\texorpdfstring{student}{student}} {\footnotesize\ttfamily \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student}{Student}} crutchesbicycles.\+studyhelper.\+domain.\+Account.\+student\hspace{0.3cm}{\ttfamily [private]}} Объявления и описания членов класса находятся в файле\+:\begin{DoxyCompactItemize} \item /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/domain/\mbox{\hyperlink{_account_8java}{Account.\+java}}\end{DoxyCompactItemize} ======================= File: code_doc/latex/_schedule_8java.tex ======================= \hypertarget{_schedule_8java}{}\doxysection{Файл /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/domain/\+Schedule.java} \label{_schedule_8java}\index{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/domain/Schedule.java@{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/domain/Schedule.java}} \doxysubsection*{Классы} \begin{DoxyCompactItemize} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule}{crutchesbicycles.\+studyhelper.\+domain.\+Schedule}} \end{DoxyCompactItemize} \doxysubsection*{Пакеты} \begin{DoxyCompactItemize} \item package \mbox{\hyperlink{namespacecrutchesbicycles_1_1studyhelper_1_1domain}{crutchesbicycles.\+studyhelper.\+domain}} \end{DoxyCompactItemize} ======================= File: code_doc/latex/_day_repository_8java.tex ======================= <filename>code_doc/latex/_day_repository_8java.tex \hypertarget{_day_repository_8java}{}\doxysection{Файл /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/repos/\+Day\+Repository.java} \label{_day_repository_8java}\index{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/repos/DayRepository.java@{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/repos/DayRepository.java}} \doxysubsection*{Классы} \begin{DoxyCompactItemize} \item interface \mbox{\hyperlink{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_day_repository}{crutchesbicycles.\+studyhelper.\+repos.\+Day\+Repository}} \end{DoxyCompactItemize} \doxysubsection*{Пакеты} \begin{DoxyCompactItemize} \item package \mbox{\hyperlink{namespacecrutchesbicycles_1_1studyhelper_1_1repos}{crutchesbicycles.\+studyhelper.\+repos}} \end{DoxyCompactItemize} ======================= File: code_doc/latex/_subject_controller_test_8java.tex ======================= <filename>code_doc/latex/_subject_controller_test_8java.tex \hypertarget{_subject_controller_test_8java}{}\doxysection{Файл /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/test/java/crutchesbicycles/studyhelper/\+Subject\+Controller\+Test.java} \label{_subject_controller_test_8java}\index{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/test/java/crutchesbicycles/studyhelper/SubjectControllerTest.java@{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/test/java/crutchesbicycles/studyhelper/SubjectControllerTest.java}} \doxysubsection*{Классы} \begin{DoxyCompactItemize} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_subject_controller_test}{crutchesbicycles.\+studyhelper.\+Subject\+Controller\+Test}} \end{DoxyCompactItemize} \doxysubsection*{Пакеты} \begin{DoxyCompactItemize} \item package \mbox{\hyperlink{namespacecrutchesbicycles_1_1studyhelper}{crutchesbicycles.\+studyhelper}} \end{DoxyCompactItemize} ======================= File: code_doc/latex/_auth_controller_8java.tex ======================= \hypertarget{_auth_controller_8java}{}\doxysection{Файл /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/controller/\+Auth\+Controller.java} \label{_auth_controller_8java}\index{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/controller/AuthController.java@{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/controller/AuthController.java}} \doxysubsection*{Классы} \begin{DoxyCompactItemize} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_auth_controller}{crutchesbicycles.\+studyhelper.\+controller.\+Auth\+Controller}} \end{DoxyCompactItemize} \doxysubsection*{Пакеты} \begin{DoxyCompactItemize} \item package \mbox{\hyperlink{namespacecrutchesbicycles_1_1studyhelper_1_1controller}{crutchesbicycles.\+studyhelper.\+controller}} \end{DoxyCompactItemize} ======================= File: code_doc/latex/_student_controller_8java.tex ======================= <reponame>vgtstptlk/StudyHelper_REST_API \hypertarget{_student_controller_8java}{}\doxysection{Файл /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/controller/\+Student\+Controller.java} \label{_student_controller_8java}\index{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/controller/StudentController.java@{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/controller/StudentController.java}} \doxysubsection*{Классы} \begin{DoxyCompactItemize} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_student_controller}{crutchesbicycles.\+studyhelper.\+controller.\+Student\+Controller}} \end{DoxyCompactItemize} \doxysubsection*{Пакеты} \begin{DoxyCompactItemize} \item package \mbox{\hyperlink{namespacecrutchesbicycles_1_1studyhelper_1_1controller}{crutchesbicycles.\+studyhelper.\+controller}} \end{DoxyCompactItemize} ======================= File: code_doc/latex/classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_account_exists_exception.tex ======================= \hypertarget{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_account_exists_exception}{}\doxysection{Класс crutchesbicycles.\+studyhelper.\+exception.\+Account\+Exists\+Exception} \label{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_account_exists_exception}\index{crutchesbicycles.studyhelper.exception.AccountExistsException@{crutchesbicycles.studyhelper.exception.AccountExistsException}} Граф наследования\+:crutchesbicycles.\+studyhelper.\+exception.\+Account\+Exists\+Exception\+:\begin{figure}[H] \begin{center} \leavevmode \includegraphics[height=2.000000cm]{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_account_exists_exception} \end{center} \end{figure} \doxysubsection*{Открытые члены} \begin{DoxyCompactItemize} \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_account_exists_exception_a1a8e708ee998be17c9f34dd1bcfa0c01}{Account\+Exists\+Exception}} (String email) \end{DoxyCompactItemize} \doxysubsection{Конструктор(ы)} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_account_exists_exception_a1a8e708ee998be17c9f34dd1bcfa0c01}\label{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_account_exists_exception_a1a8e708ee998be17c9f34dd1bcfa0c01}} \index{crutchesbicycles.studyhelper.exception.AccountExistsException@{crutchesbicycles.studyhelper.exception.AccountExistsException}!AccountExistsException@{AccountExistsException}} \index{AccountExistsException@{AccountExistsException}!crutchesbicycles.studyhelper.exception.AccountExistsException@{crutchesbicycles.studyhelper.exception.AccountExistsException}} \doxysubsubsection{\texorpdfstring{AccountExistsException()}{AccountExistsException()}} {\footnotesize\ttfamily crutchesbicycles.\+studyhelper.\+exception.\+Account\+Exists\+Exception.\+Account\+Exists\+Exception (\begin{DoxyParamCaption}\item[{String}]{email }\end{DoxyParamCaption})} Объявления и описания членов класса находятся в файле\+:\begin{DoxyCompactItemize} \item /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/exception/\mbox{\hyperlink{_account_exists_exception_8java}{Account\+Exists\+Exception.\+java}}\end{DoxyCompactItemize} ======================= File: code_doc/latex/_schedule_record_repository_8java.tex ======================= <reponame>vgtstptlk/StudyHelper_REST_API<filename>code_doc/latex/_schedule_record_repository_8java.tex \hypertarget{_schedule_record_repository_8java}{}\doxysection{Файл /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/repos/\+Schedule\+Record\+Repository.java} \label{_schedule_record_repository_8java}\index{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/repos/ScheduleRecordRepository.java@{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/repos/ScheduleRecordRepository.java}} \doxysubsection*{Классы} \begin{DoxyCompactItemize} \item interface \mbox{\hyperlink{interfacecrutchesbicycles_1_1studyhelper_1_1repos_1_1_schedule_record_repository}{crutchesbicycles.\+studyhelper.\+repos.\+Schedule\+Record\+Repository}} \end{DoxyCompactItemize} \doxysubsection*{Пакеты} \begin{DoxyCompactItemize} \item package \mbox{\hyperlink{namespacecrutchesbicycles_1_1studyhelper_1_1repos}{crutchesbicycles.\+studyhelper.\+repos}} \end{DoxyCompactItemize} ======================= File: code_doc/latex/classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_subject_exist_exception.tex ======================= \hypertarget{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_subject_exist_exception}{}\doxysection{Класс crutchesbicycles.\+studyhelper.\+exception.\+Subject\+Exist\+Exception} \label{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_subject_exist_exception}\index{crutchesbicycles.studyhelper.exception.SubjectExistException@{crutchesbicycles.studyhelper.exception.SubjectExistException}} Граф наследования\+:crutchesbicycles.\+studyhelper.\+exception.\+Subject\+Exist\+Exception\+:\begin{figure}[H] \begin{center} \leavevmode \includegraphics[height=2.000000cm]{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_subject_exist_exception} \end{center} \end{figure} \doxysubsection*{Открытые члены} \begin{DoxyCompactItemize} \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_subject_exist_exception_ab6a478625b81b636ea46b1aaa7be86b2}{Subject\+Exist\+Exception}} (String caption) \end{DoxyCompactItemize} \doxysubsection{Конструктор(ы)} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_subject_exist_exception_ab6a478625b81b636ea46b1aaa7be86b2}\label{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_subject_exist_exception_ab6a478625b81b636ea46b1aaa7be86b2}} \index{crutchesbicycles.studyhelper.exception.SubjectExistException@{crutchesbicycles.studyhelper.exception.SubjectExistException}!SubjectExistException@{SubjectExistException}} \index{SubjectExistException@{SubjectExistException}!crutchesbicycles.studyhelper.exception.SubjectExistException@{crutchesbicycles.studyhelper.exception.SubjectExistException}} \doxysubsubsection{\texorpdfstring{SubjectExistException()}{SubjectExistException()}} {\footnotesize\ttfamily crutchesbicycles.\+studyhelper.\+exception.\+Subject\+Exist\+Exception.\+Subject\+Exist\+Exception (\begin{DoxyParamCaption}\item[{String}]{caption }\end{DoxyParamCaption})} Объявления и описания членов класса находятся в файле\+:\begin{DoxyCompactItemize} \item /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/exception/\mbox{\hyperlink{_subject_exist_exception_8java}{Subject\+Exist\+Exception.\+java}}\end{DoxyCompactItemize} ======================= File: code_doc/latex/classcrutchesbicycles_1_1studyhelper_1_1_studyhelper_application.tex ======================= <filename>code_doc/latex/classcrutchesbicycles_1_1studyhelper_1_1_studyhelper_application.tex<gh_stars>0 \hypertarget{classcrutchesbicycles_1_1studyhelper_1_1_studyhelper_application}{}\doxysection{Класс crutchesbicycles.\+studyhelper.\+Studyhelper\+Application} \label{classcrutchesbicycles_1_1studyhelper_1_1_studyhelper_application}\index{crutchesbicycles.studyhelper.StudyhelperApplication@{crutchesbicycles.studyhelper.StudyhelperApplication}} \doxysubsection*{Открытые статические члены} \begin{DoxyCompactItemize} \item static void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1_studyhelper_application_ad9b2a1d202d5f151360015091f8037d9}{main}} (String\mbox{[}$\,$\mbox{]} args) \end{DoxyCompactItemize} \doxysubsection{Методы} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1_studyhelper_application_ad9b2a1d202d5f151360015091f8037d9}\label{classcrutchesbicycles_1_1studyhelper_1_1_studyhelper_application_ad9b2a1d202d5f151360015091f8037d9}} \index{crutchesbicycles.studyhelper.StudyhelperApplication@{crutchesbicycles.studyhelper.StudyhelperApplication}!main@{main}} \index{main@{main}!crutchesbicycles.studyhelper.StudyhelperApplication@{crutchesbicycles.studyhelper.StudyhelperApplication}} \doxysubsubsection{\texorpdfstring{main()}{main()}} {\footnotesize\ttfamily static void crutchesbicycles.\+studyhelper.\+Studyhelper\+Application.\+main (\begin{DoxyParamCaption}\item[{String\mbox{[}$\,$\mbox{]}}]{args }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}} Объявления и описания членов класса находятся в файле\+:\begin{DoxyCompactItemize} \item /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/\mbox{\hyperlink{_studyhelper_application_8java}{Studyhelper\+Application.\+java}}\end{DoxyCompactItemize} ======================= File: code_doc/latex/_student_material_8java.tex ======================= \hypertarget{_student_material_8java}{}\doxysection{Файл /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/domain/\+Student\+Material.java} \label{_student_material_8java}\index{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/domain/StudentMaterial.java@{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/domain/StudentMaterial.java}} \doxysubsection*{Классы} \begin{DoxyCompactItemize} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material}{crutchesbicycles.\+studyhelper.\+domain.\+Student\+Material}} \end{DoxyCompactItemize} \doxysubsection*{Пакеты} \begin{DoxyCompactItemize} \item package \mbox{\hyperlink{namespacecrutchesbicycles_1_1studyhelper_1_1domain}{crutchesbicycles.\+studyhelper.\+domain}} \end{DoxyCompactItemize} ======================= File: code_doc/latex/namespacecrutchesbicycles_1_1studyhelper_1_1security_1_1jwt.tex ======================= \hypertarget{namespacecrutchesbicycles_1_1studyhelper_1_1security_1_1jwt}{}\doxysection{Пакет crutchesbicycles.\+studyhelper.\+security.\+jwt} \label{namespacecrutchesbicycles_1_1studyhelper_1_1security_1_1jwt}\index{crutchesbicycles.studyhelper.security.jwt@{crutchesbicycles.studyhelper.security.jwt}} \doxysubsection*{Классы} \begin{DoxyCompactItemize} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_authentication_exception}{Jwt\+Authentication\+Exception}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_configurer}{Jwt\+Configurer}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_token_filter}{Jwt\+Token\+Filter}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_token_provider}{Jwt\+Token\+Provider}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_user}{Jwt\+User}} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1security_1_1jwt_1_1_jwt_user_factory}{Jwt\+User\+Factory}} \end{DoxyCompactItemize} ======================= File: code_doc/latex/_user_detail_controller_8java.tex ======================= <reponame>vgtstptlk/StudyHelper_REST_API \hypertarget{_user_detail_controller_8java}{}\doxysection{Файл /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/security/\+User\+Detail\+Controller.java} \label{_user_detail_controller_8java}\index{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/security/UserDetailController.java@{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/security/UserDetailController.java}} \doxysubsection*{Классы} \begin{DoxyCompactItemize} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1security_1_1_user_detail_controller}{crutchesbicycles.\+studyhelper.\+security.\+User\+Detail\+Controller}} \end{DoxyCompactItemize} \doxysubsection*{Пакеты} \begin{DoxyCompactItemize} \item package \mbox{\hyperlink{namespacecrutchesbicycles_1_1studyhelper_1_1security}{crutchesbicycles.\+studyhelper.\+security}} \end{DoxyCompactItemize} ======================= File: code_doc/latex/_group_material_controller_8java.tex ======================= <reponame>vgtstptlk/StudyHelper_REST_API<gh_stars>0 \hypertarget{_group_material_controller_8java}{}\doxysection{Файл /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/controller/\+Group\+Material\+Controller.java} \label{_group_material_controller_8java}\index{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/controller/GroupMaterialController.java@{/Users/vgtstptlk/Desktop/МИРЭА/StudyHelper/src/main/java/crutchesbicycles/studyhelper/controller/GroupMaterialController.java}} \doxysubsection*{Классы} \begin{DoxyCompactItemize} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_group_material_controller}{crutchesbicycles.\+studyhelper.\+controller.\+Group\+Material\+Controller}} \end{DoxyCompactItemize} \doxysubsection*{Пакеты} \begin{DoxyCompactItemize} \item package \mbox{\hyperlink{namespacecrutchesbicycles_1_1studyhelper_1_1controller}{crutchesbicycles.\+studyhelper.\+controller}} \end{DoxyCompactItemize} ======================= File: code_doc/latex/classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_teacher_subject_not_found.tex ======================= <filename>code_doc/latex/classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_teacher_subject_not_found.tex \hypertarget{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_teacher_subject_not_found}{}\doxysection{Класс crutchesbicycles.\+studyhelper.\+exception.\+Teacher\+Subject\+Not\+Found} \label{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_teacher_subject_not_found}\index{crutchesbicycles.studyhelper.exception.TeacherSubjectNotFound@{crutchesbicycles.studyhelper.exception.TeacherSubjectNotFound}} Граф наследования\+:crutchesbicycles.\+studyhelper.\+exception.\+Teacher\+Subject\+Not\+Found\+:\begin{figure}[H] \begin{center} \leavevmode \includegraphics[height=2.000000cm]{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_teacher_subject_not_found} \end{center} \end{figure} \doxysubsection*{Открытые члены} \begin{DoxyCompactItemize} \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_teacher_subject_not_found_a20ce57202f233cf3f108acd416031452}{Teacher\+Subject\+Not\+Found}} (String id) \end{DoxyCompactItemize} \doxysubsection{Конструктор(ы)} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_teacher_subject_not_found_a20ce57202f233cf3f108acd416031452}\label{classcrutchesbicycles_1_1studyhelper_1_1exception_1_1_teacher_subject_not_found_a20ce57202f233cf3f108acd416031452}} \index{crutchesbicycles.studyhelper.exception.TeacherSubjectNotFound@{crutchesbicycles.studyhelper.exception.TeacherSubjectNotFound}!TeacherSubjectNotFound@{TeacherSubjectNotFound}} \index{TeacherSubjectNotFound@{TeacherSubjectNotFound}!crutchesbicycles.studyhelper.exception.TeacherSubjectNotFound@{crutchesbicycles.studyhelper.exception.TeacherSubjectNotFound}} \doxysubsubsection{\texorpdfstring{TeacherSubjectNotFound()}{TeacherSubjectNotFound()}} {\footnotesize\ttfamily crutchesbicycles.\+studyhelper.\+exception.\+Teacher\+Subject\+Not\+Found.\+Teacher\+Subject\+Not\+Found (\begin{DoxyParamCaption}\item[{String}]{id }\end{DoxyParamCaption})} Объявления и описания членов класса находятся в файле\+:\begin{DoxyCompactItemize} \item /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/exception/\mbox{\hyperlink{_teacher_subject_not_found_8java}{Teacher\+Subject\+Not\+Found.\+java}}\end{DoxyCompactItemize} ======================= File: code_doc/latex/classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material.tex ======================= <filename>code_doc/latex/classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material.tex \hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material}{}\doxysection{Класс crutchesbicycles.\+studyhelper.\+domain.\+Student\+Material} \label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material}\index{crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}} Граф наследования\+:crutchesbicycles.\+studyhelper.\+domain.\+Student\+Material\+:\begin{figure}[H] \begin{center} \leavevmode \includegraphics[height=2.000000cm]{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material} \end{center} \end{figure} \doxysubsection*{Открытые члены} \begin{DoxyCompactItemize} \item long \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_aa40c0f7ed04284ffe76eb7e059abbaaa}{get\+Id\+Material}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a13412cc4f476eebdcbf95c079d3367b5}{set\+Id\+Material}} (long \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a9a62111ecc308e07ba88b32eb0c071ca}{id\+Material}}) \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student}{Student}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a909131e620a2052e44b7bf315a43b0d7}{get\+Student}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_ac9b4c05c2f88a7cd7d995e1097c6c4f3}{set\+Student}} (\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student}{Student}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_ab5c4d1441327447d5b0419c653d8bbb3}{student}}) \item String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a897ce20ccdc74379bae3ea01ea69a709}{get\+Link\+To}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_abde744259e1234ef9acc0a4866c7880c}{set\+Link\+To}} (String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a077215114631596b1d811a9e538c1007}{link\+To}}) \item String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a3e5a2d6b3ed08d6ed1b5bcf893558786}{get\+File}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a24f71212fbf563156435d8b58d8ddf9f}{set\+File}} (String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a8386b8ae9674120a9fdd3e4e9e392270}{file}}) \item String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a9b4c3e342f5a56e1d65489f29cf11075}{get\+Caption}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a8a45bb2c8daa4386b359a59e9d51db32}{set\+Caption}} (String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_ab798c85f6ff3a82abbe7185472b00037}{caption}}) \item String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_ae95da7fabdc528327749c7cfc44f05a5}{get\+Description}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_ad5e946cfb9f34b03c8d6a7d9fd87228c}{set\+Description}} (String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a69bafeb910ccff4defd1dcc45419ed51}{description}}) \item List$<$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}} $>$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a58d471c77cce951df64476b2d9a9d03c}{get\+Subject}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_ab219bd476de3ba4645a4088d78c2fa9e}{set\+Subject}} (List$<$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}} $>$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a85e3f63a65e4f6741eb8eaee1e8e7eca}{subject}}) \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a44f9b606559d5453f7df001dccecab5f}{Student\+Material}} () \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a97a1398d293f32594a61aa0a2607d7b8}{Student\+Material}} (\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student}{Student}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_ab5c4d1441327447d5b0419c653d8bbb3}{student}}, String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a077215114631596b1d811a9e538c1007}{link\+To}}, String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a8386b8ae9674120a9fdd3e4e9e392270}{file}}, String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_ab798c85f6ff3a82abbe7185472b00037}{caption}}, String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a69bafeb910ccff4defd1dcc45419ed51}{description}}, List$<$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}} $>$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a85e3f63a65e4f6741eb8eaee1e8e7eca}{subject}}) \end{DoxyCompactItemize} \doxysubsection*{Закрытые данные} \begin{DoxyCompactItemize} \item long \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a9a62111ecc308e07ba88b32eb0c071ca}{id\+Material}} \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student}{Student}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_ab5c4d1441327447d5b0419c653d8bbb3}{student}} \item String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a077215114631596b1d811a9e538c1007}{link\+To}} \item String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a8386b8ae9674120a9fdd3e4e9e392270}{file}} \item String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_ab798c85f6ff3a82abbe7185472b00037}{caption}} \item String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a69bafeb910ccff4defd1dcc45419ed51}{description}} \item List$<$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}} $>$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a85e3f63a65e4f6741eb8eaee1e8e7eca}{subject}} \end{DoxyCompactItemize} \doxysubsection{Подробное описание} Сущность \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material}{Student\+Material}}. Материалы студента. ~\newline Состоит из полей\+: \begin{DoxyParams}{Аргументы} {\em id\+Material} & \\ \hline {\em student} & -- студенты \\ \hline {\em link\+To} & -- местоположение файла (ссылка) \\ \hline {\em file} & -- навзание файла \\ \hline {\em caption} & -- публичное название файла \\ \hline {\em description} & -- описание файла \\ \hline {\em subject} & -- метки предметов \\ \hline \end{DoxyParams} \begin{DoxyAuthor}{Автор} vgtstptlk / <NAME> \end{DoxyAuthor} \begin{DoxyVersion}{Версия} 1.\+0.\+0 \end{DoxyVersion} \doxysubsection{Конструктор(ы)} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a44f9b606559d5453f7df001dccecab5f}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a44f9b606559d5453f7df001dccecab5f}} \index{crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}!StudentMaterial@{StudentMaterial}} \index{StudentMaterial@{StudentMaterial}!crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}} \doxysubsubsection{\texorpdfstring{StudentMaterial()}{StudentMaterial()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}} {\footnotesize\ttfamily crutchesbicycles.\+studyhelper.\+domain.\+Student\+Material.\+Student\+Material (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a97a1398d293f32594a61aa0a2607d7b8}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a97a1398d293f32594a61aa0a2607d7b8}} \index{crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}!StudentMaterial@{StudentMaterial}} \index{StudentMaterial@{StudentMaterial}!crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}} \doxysubsubsection{\texorpdfstring{StudentMaterial()}{StudentMaterial()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}} {\footnotesize\ttfamily crutchesbicycles.\+studyhelper.\+domain.\+Student\+Material.\+Student\+Material (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student}{Student}}}]{student, }\item[{String}]{link\+To, }\item[{String}]{file, }\item[{String}]{caption, }\item[{String}]{description, }\item[{List$<$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}} $>$}]{subject }\end{DoxyParamCaption})} \doxysubsection{Методы} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a9b4c3e342f5a56e1d65489f29cf11075}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a9b4c3e342f5a56e1d65489f29cf11075}} \index{crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}!getCaption@{getCaption}} \index{getCaption@{getCaption}!crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}} \doxysubsubsection{\texorpdfstring{getCaption()}{getCaption()}} {\footnotesize\ttfamily String crutchesbicycles.\+studyhelper.\+domain.\+Student\+Material.\+get\+Caption (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_ae95da7fabdc528327749c7cfc44f05a5}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_ae95da7fabdc528327749c7cfc44f05a5}} \index{crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}!getDescription@{getDescription}} \index{getDescription@{getDescription}!crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}} \doxysubsubsection{\texorpdfstring{getDescription()}{getDescription()}} {\footnotesize\ttfamily String crutchesbicycles.\+studyhelper.\+domain.\+Student\+Material.\+get\+Description (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a3e5a2d6b3ed08d6ed1b5bcf893558786}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a3e5a2d6b3ed08d6ed1b5bcf893558786}} \index{crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}!getFile@{getFile}} \index{getFile@{getFile}!crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}} \doxysubsubsection{\texorpdfstring{getFile()}{getFile()}} {\footnotesize\ttfamily String crutchesbicycles.\+studyhelper.\+domain.\+Student\+Material.\+get\+File (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_aa40c0f7ed04284ffe76eb7e059abbaaa}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_aa40c0f7ed04284ffe76eb7e059abbaaa}} \index{crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}!getIdMaterial@{getIdMaterial}} \index{getIdMaterial@{getIdMaterial}!crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}} \doxysubsubsection{\texorpdfstring{getIdMaterial()}{getIdMaterial()}} {\footnotesize\ttfamily long crutchesbicycles.\+studyhelper.\+domain.\+Student\+Material.\+get\+Id\+Material (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a897ce20ccdc74379bae3ea01ea69a709}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a897ce20ccdc74379bae3ea01ea69a709}} \index{crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}!getLinkTo@{getLinkTo}} \index{getLinkTo@{getLinkTo}!crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}} \doxysubsubsection{\texorpdfstring{getLinkTo()}{getLinkTo()}} {\footnotesize\ttfamily String crutchesbicycles.\+studyhelper.\+domain.\+Student\+Material.\+get\+Link\+To (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a909131e620a2052e44b7bf315a43b0d7}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a909131e620a2052e44b7bf315a43b0d7}} \index{crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}!getStudent@{getStudent}} \index{getStudent@{getStudent}!crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}} \doxysubsubsection{\texorpdfstring{getStudent()}{getStudent()}} {\footnotesize\ttfamily \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student}{Student}} crutchesbicycles.\+studyhelper.\+domain.\+Student\+Material.\+get\+Student (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a58d471c77cce951df64476b2d9a9d03c}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a58d471c77cce951df64476b2d9a9d03c}} \index{crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}!getSubject@{getSubject}} \index{getSubject@{getSubject}!crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}} \doxysubsubsection{\texorpdfstring{getSubject()}{getSubject()}} {\footnotesize\ttfamily List$<$\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}}$>$ crutchesbicycles.\+studyhelper.\+domain.\+Student\+Material.\+get\+Subject (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a8a45bb2c8daa4386b359a59e9d51db32}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a8a45bb2c8daa4386b359a59e9d51db32}} \index{crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}!setCaption@{setCaption}} \index{setCaption@{setCaption}!crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}} \doxysubsubsection{\texorpdfstring{setCaption()}{setCaption()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+domain.\+Student\+Material.\+set\+Caption (\begin{DoxyParamCaption}\item[{String}]{caption }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_ad5e946cfb9f34b03c8d6a7d9fd87228c}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_ad5e946cfb9f34b03c8d6a7d9fd87228c}} \index{crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}!setDescription@{setDescription}} \index{setDescription@{setDescription}!crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}} \doxysubsubsection{\texorpdfstring{setDescription()}{setDescription()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+domain.\+Student\+Material.\+set\+Description (\begin{DoxyParamCaption}\item[{String}]{description }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a24f71212fbf563156435d8b58d8ddf9f}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a24f71212fbf563156435d8b58d8ddf9f}} \index{crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}!setFile@{setFile}} \index{setFile@{setFile}!crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}} \doxysubsubsection{\texorpdfstring{setFile()}{setFile()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+domain.\+Student\+Material.\+set\+File (\begin{DoxyParamCaption}\item[{String}]{file }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a13412cc4f476eebdcbf95c079d3367b5}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a13412cc4f476eebdcbf95c079d3367b5}} \index{crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}!setIdMaterial@{setIdMaterial}} \index{setIdMaterial@{setIdMaterial}!crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}} \doxysubsubsection{\texorpdfstring{setIdMaterial()}{setIdMaterial()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+domain.\+Student\+Material.\+set\+Id\+Material (\begin{DoxyParamCaption}\item[{long}]{id\+Material }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_abde744259e1234ef9acc0a4866c7880c}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_abde744259e1234ef9acc0a4866c7880c}} \index{crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}!setLinkTo@{setLinkTo}} \index{setLinkTo@{setLinkTo}!crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}} \doxysubsubsection{\texorpdfstring{setLinkTo()}{setLinkTo()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+domain.\+Student\+Material.\+set\+Link\+To (\begin{DoxyParamCaption}\item[{String}]{link\+To }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_ac9b4c05c2f88a7cd7d995e1097c6c4f3}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_ac9b4c05c2f88a7cd7d995e1097c6c4f3}} \index{crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}!setStudent@{setStudent}} \index{setStudent@{setStudent}!crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}} \doxysubsubsection{\texorpdfstring{setStudent()}{setStudent()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+domain.\+Student\+Material.\+set\+Student (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student}{Student}}}]{student }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_ab219bd476de3ba4645a4088d78c2fa9e}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_ab219bd476de3ba4645a4088d78c2fa9e}} \index{crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}!setSubject@{setSubject}} \index{setSubject@{setSubject}!crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}} \doxysubsubsection{\texorpdfstring{setSubject()}{setSubject()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+domain.\+Student\+Material.\+set\+Subject (\begin{DoxyParamCaption}\item[{List$<$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}} $>$}]{subject }\end{DoxyParamCaption})} \doxysubsection{Данные класса} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_ab798c85f6ff3a82abbe7185472b00037}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_ab798c85f6ff3a82abbe7185472b00037}} \index{crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}!caption@{caption}} \index{caption@{caption}!crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}} \doxysubsubsection{\texorpdfstring{caption}{caption}} {\footnotesize\ttfamily String crutchesbicycles.\+studyhelper.\+domain.\+Student\+Material.\+caption\hspace{0.3cm}{\ttfamily [private]}} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a69bafeb910ccff4defd1dcc45419ed51}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a69bafeb910ccff4defd1dcc45419ed51}} \index{crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}!description@{description}} \index{description@{description}!crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}} \doxysubsubsection{\texorpdfstring{description}{description}} {\footnotesize\ttfamily String crutchesbicycles.\+studyhelper.\+domain.\+Student\+Material.\+description\hspace{0.3cm}{\ttfamily [private]}} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a8386b8ae9674120a9fdd3e4e9e392270}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a8386b8ae9674120a9fdd3e4e9e392270}} \index{crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}!file@{file}} \index{file@{file}!crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}} \doxysubsubsection{\texorpdfstring{file}{file}} {\footnotesize\ttfamily String crutchesbicycles.\+studyhelper.\+domain.\+Student\+Material.\+file\hspace{0.3cm}{\ttfamily [private]}} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a9a62111ecc308e07ba88b32eb0c071ca}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a9a62111ecc308e07ba88b32eb0c071ca}} \index{crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}!idMaterial@{idMaterial}} \index{idMaterial@{idMaterial}!crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}} \doxysubsubsection{\texorpdfstring{idMaterial}{idMaterial}} {\footnotesize\ttfamily long crutchesbicycles.\+studyhelper.\+domain.\+Student\+Material.\+id\+Material\hspace{0.3cm}{\ttfamily [private]}} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a077215114631596b1d811a9e538c1007}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a077215114631596b1d811a9e538c1007}} \index{crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}!linkTo@{linkTo}} \index{linkTo@{linkTo}!crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}} \doxysubsubsection{\texorpdfstring{linkTo}{linkTo}} {\footnotesize\ttfamily String crutchesbicycles.\+studyhelper.\+domain.\+Student\+Material.\+link\+To\hspace{0.3cm}{\ttfamily [private]}} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_ab5c4d1441327447d5b0419c653d8bbb3}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_ab5c4d1441327447d5b0419c653d8bbb3}} \index{crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}!student@{student}} \index{student@{student}!crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}} \doxysubsubsection{\texorpdfstring{student}{student}} {\footnotesize\ttfamily \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student}{Student}} crutchesbicycles.\+studyhelper.\+domain.\+Student\+Material.\+student\hspace{0.3cm}{\ttfamily [private]}} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a85e3f63a65e4f6741eb8eaee1e8e7eca}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_student_material_a85e3f63a65e4f6741eb8eaee1e8e7eca}} \index{crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}!subject@{subject}} \index{subject@{subject}!crutchesbicycles.studyhelper.domain.StudentMaterial@{crutchesbicycles.studyhelper.domain.StudentMaterial}} \doxysubsubsection{\texorpdfstring{subject}{subject}} {\footnotesize\ttfamily List$<$\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}}$>$ crutchesbicycles.\+studyhelper.\+domain.\+Student\+Material.\+subject\hspace{0.3cm}{\ttfamily [private]}} Объявления и описания членов класса находятся в файле\+:\begin{DoxyCompactItemize} \item /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/domain/\mbox{\hyperlink{_student_material_8java}{Student\+Material.\+java}}\end{DoxyCompactItemize} ======================= File: code_doc/latex/classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record.tex ======================= <reponame>vgtstptlk/StudyHelper_REST_API<filename>code_doc/latex/classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record.tex \hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record}{}\doxysection{Класс crutchesbicycles.\+studyhelper.\+domain.\+Schedule\+Record} \label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record}\index{crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}} Граф наследования\+:crutchesbicycles.\+studyhelper.\+domain.\+Schedule\+Record\+:\begin{figure}[H] \begin{center} \leavevmode \includegraphics[height=2.000000cm]{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record} \end{center} \end{figure} \doxysubsection*{Открытые члены} \begin{DoxyCompactItemize} \item long \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_adff989cb9303b55e8ba5ac9c53f3983e}{get\+Id\+Schedule\+Record}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a3f1afc633b509bb539f1170b050e6bfb}{set\+Id\+Schedule\+Record}} (long \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a20120131bd6922a4a9b6c3027eab3e79}{id\+Schedule\+Record}}) \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule}{Schedule}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a798259df424dcba1bf3efe4080e2b307}{get\+Schedule}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a242d312706a703f6e166a10ff3ff59bb}{set\+Schedule}} (\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule}{Schedule}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a1b77b1f0996f0d17d672272f3a2582f7}{schedule}}) \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_day}{Day}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a0f4b3a2016e1804e10139c14c4059d4d}{get\+Days}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_ae85635235f73a72d55c3ec2119e87994}{set\+Days}} (\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_day}{Day}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_aaaeded90d39ae4f9affa2e277b7fec29}{days}}) \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_pair}{Pair}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a0ba6d1fa37e854eccbbfebb5fe9637c9}{get\+Pairs}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_abbc98be702a487135ad289677754732a}{set\+Pairs}} (\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_pair}{Pair}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_aa0997abf176915a4a2b78246ff23983e}{pairs}}) \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a19bba1381a68ee2f7c274c75a5220d05}{get\+Subject\+Even}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a63a83080252406aa4a562f2c465fa472}{set\+Subject\+Even}} (\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a059247af08c825bff4b84d472c289bda}{subject\+Even}}) \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a5a354a1f2912baf8e487cd0d14053312}{get\+Subject\+Odd}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a25f562b30192f84dfed04d285a09cf90}{set\+Subject\+Odd}} (\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a760243f8223581a8185aea7197da4ce5}{subject\+Odd}}) \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a719c9443519d4ad6e5997a77cf37cab3}{Schedule\+Record}} () \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_adc8705638f13fe8568c32198511ecbcd}{Schedule\+Record}} (\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule}{Schedule}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a1b77b1f0996f0d17d672272f3a2582f7}{schedule}}, \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_day}{Day}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_aaaeded90d39ae4f9affa2e277b7fec29}{days}}, \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_pair}{Pair}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_aa0997abf176915a4a2b78246ff23983e}{pairs}}, \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a059247af08c825bff4b84d472c289bda}{subject\+Even}}, \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a760243f8223581a8185aea7197da4ce5}{subject\+Odd}}) \end{DoxyCompactItemize} \doxysubsection*{Закрытые данные} \begin{DoxyCompactItemize} \item long \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a20120131bd6922a4a9b6c3027eab3e79}{id\+Schedule\+Record}} \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule}{Schedule}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a1b77b1f0996f0d17d672272f3a2582f7}{schedule}} \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_day}{Day}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_aaaeded90d39ae4f9affa2e277b7fec29}{days}} \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_pair}{Pair}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_aa0997abf176915a4a2b78246ff23983e}{pairs}} \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a059247af08c825bff4b84d472c289bda}{subject\+Even}} \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a760243f8223581a8185aea7197da4ce5}{subject\+Odd}} \end{DoxyCompactItemize} \doxysubsection{Подробное описание} Сущность \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record}{Schedule\+Record}}. Записи в расписании. ~\newline Состоит из полей\+: \begin{DoxyParams}{Аргументы} {\em id\+Schedule\+Record} & \\ \hline {\em schedule} & -- полное расписание \\ \hline {\em days} & -- день пары \\ \hline {\em pairs} & -- номер пары \\ \hline {\em subject\+Even} & -- пара на четной неделе \\ \hline {\em subject\+Odd} & -- пара на нечетной неделе \\ \hline \end{DoxyParams} \begin{DoxyAuthor}{Автор} vgtstptlk / <NAME> \end{DoxyAuthor} \begin{DoxyVersion}{Версия} 1.\+0.\+0 \end{DoxyVersion} \doxysubsection{Конструктор(ы)} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a719c9443519d4ad6e5997a77cf37cab3}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a719c9443519d4ad6e5997a77cf37cab3}} \index{crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}!ScheduleRecord@{ScheduleRecord}} \index{ScheduleRecord@{ScheduleRecord}!crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}} \doxysubsubsection{\texorpdfstring{ScheduleRecord()}{ScheduleRecord()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}} {\footnotesize\ttfamily crutchesbicycles.\+studyhelper.\+domain.\+Schedule\+Record.\+Schedule\+Record (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_adc8705638f13fe8568c32198511ecbcd}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_adc8705638f13fe8568c32198511ecbcd}} \index{crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}!ScheduleRecord@{ScheduleRecord}} \index{ScheduleRecord@{ScheduleRecord}!crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}} \doxysubsubsection{\texorpdfstring{ScheduleRecord()}{ScheduleRecord()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}} {\footnotesize\ttfamily crutchesbicycles.\+studyhelper.\+domain.\+Schedule\+Record.\+Schedule\+Record (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule}{Schedule}}}]{schedule, }\item[{\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_day}{Day}}}]{days, }\item[{\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_pair}{Pair}}}]{pairs, }\item[{\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}}}]{subject\+Even, }\item[{\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}}}]{subject\+Odd }\end{DoxyParamCaption})} \doxysubsection{Методы} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a0f4b3a2016e1804e10139c14c4059d4d}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a0f4b3a2016e1804e10139c14c4059d4d}} \index{crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}!getDays@{getDays}} \index{getDays@{getDays}!crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}} \doxysubsubsection{\texorpdfstring{getDays()}{getDays()}} {\footnotesize\ttfamily \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_day}{Day}} crutchesbicycles.\+studyhelper.\+domain.\+Schedule\+Record.\+get\+Days (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_adff989cb9303b55e8ba5ac9c53f3983e}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_adff989cb9303b55e8ba5ac9c53f3983e}} \index{crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}!getIdScheduleRecord@{getIdScheduleRecord}} \index{getIdScheduleRecord@{getIdScheduleRecord}!crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}} \doxysubsubsection{\texorpdfstring{getIdScheduleRecord()}{getIdScheduleRecord()}} {\footnotesize\ttfamily long crutchesbicycles.\+studyhelper.\+domain.\+Schedule\+Record.\+get\+Id\+Schedule\+Record (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a0ba6d1fa37e854eccbbfebb5fe9637c9}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a0ba6d1fa37e854eccbbfebb5fe9637c9}} \index{crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}!getPairs@{getPairs}} \index{getPairs@{getPairs}!crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}} \doxysubsubsection{\texorpdfstring{getPairs()}{getPairs()}} {\footnotesize\ttfamily \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_pair}{Pair}} crutchesbicycles.\+studyhelper.\+domain.\+Schedule\+Record.\+get\+Pairs (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a798259df424dcba1bf3efe4080e2b307}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a798259df424dcba1bf3efe4080e2b307}} \index{crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}!getSchedule@{getSchedule}} \index{getSchedule@{getSchedule}!crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}} \doxysubsubsection{\texorpdfstring{getSchedule()}{getSchedule()}} {\footnotesize\ttfamily \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule}{Schedule}} crutchesbicycles.\+studyhelper.\+domain.\+Schedule\+Record.\+get\+Schedule (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a19bba1381a68ee2f7c274c75a5220d05}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a19bba1381a68ee2f7c274c75a5220d05}} \index{crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}!getSubjectEven@{getSubjectEven}} \index{getSubjectEven@{getSubjectEven}!crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}} \doxysubsubsection{\texorpdfstring{getSubjectEven()}{getSubjectEven()}} {\footnotesize\ttfamily \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}} crutchesbicycles.\+studyhelper.\+domain.\+Schedule\+Record.\+get\+Subject\+Even (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a5a354a1f2912baf8e487cd0d14053312}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a5a354a1f2912baf8e487cd0d14053312}} \index{crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}!getSubjectOdd@{getSubjectOdd}} \index{getSubjectOdd@{getSubjectOdd}!crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}} \doxysubsubsection{\texorpdfstring{getSubjectOdd()}{getSubjectOdd()}} {\footnotesize\ttfamily \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}} crutchesbicycles.\+studyhelper.\+domain.\+Schedule\+Record.\+get\+Subject\+Odd (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_ae85635235f73a72d55c3ec2119e87994}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_ae85635235f73a72d55c3ec2119e87994}} \index{crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}!setDays@{setDays}} \index{setDays@{setDays}!crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}} \doxysubsubsection{\texorpdfstring{setDays()}{setDays()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+domain.\+Schedule\+Record.\+set\+Days (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_day}{Day}}}]{days }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a3f1afc633b509bb539f1170b050e6bfb}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a3f1afc633b509bb539f1170b050e6bfb}} \index{crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}!setIdScheduleRecord@{setIdScheduleRecord}} \index{setIdScheduleRecord@{setIdScheduleRecord}!crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}} \doxysubsubsection{\texorpdfstring{setIdScheduleRecord()}{setIdScheduleRecord()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+domain.\+Schedule\+Record.\+set\+Id\+Schedule\+Record (\begin{DoxyParamCaption}\item[{long}]{id\+Schedule\+Record }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_abbc98be702a487135ad289677754732a}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_abbc98be702a487135ad289677754732a}} \index{crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}!setPairs@{setPairs}} \index{setPairs@{setPairs}!crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}} \doxysubsubsection{\texorpdfstring{setPairs()}{setPairs()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+domain.\+Schedule\+Record.\+set\+Pairs (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_pair}{Pair}}}]{pairs }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a242d312706a703f6e166a10ff3ff59bb}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a242d312706a703f6e166a10ff3ff59bb}} \index{crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}!setSchedule@{setSchedule}} \index{setSchedule@{setSchedule}!crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}} \doxysubsubsection{\texorpdfstring{setSchedule()}{setSchedule()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+domain.\+Schedule\+Record.\+set\+Schedule (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule}{Schedule}}}]{schedule }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a63a83080252406aa4a562f2c465fa472}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a63a83080252406aa4a562f2c465fa472}} \index{crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}!setSubjectEven@{setSubjectEven}} \index{setSubjectEven@{setSubjectEven}!crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}} \doxysubsubsection{\texorpdfstring{setSubjectEven()}{setSubjectEven()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+domain.\+Schedule\+Record.\+set\+Subject\+Even (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}}}]{subject\+Even }\end{DoxyParamCaption})} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a25f562b30192f84dfed04d285a09cf90}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a25f562b30192f84dfed04d285a09cf90}} \index{crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}!setSubjectOdd@{setSubjectOdd}} \index{setSubjectOdd@{setSubjectOdd}!crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}} \doxysubsubsection{\texorpdfstring{setSubjectOdd()}{setSubjectOdd()}} {\footnotesize\ttfamily void crutchesbicycles.\+studyhelper.\+domain.\+Schedule\+Record.\+set\+Subject\+Odd (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}}}]{subject\+Odd }\end{DoxyParamCaption})} \doxysubsection{Данные класса} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_aaaeded90d39ae4f9affa2e277b7fec29}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_aaaeded90d39ae4f9affa2e277b7fec29}} \index{crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}!days@{days}} \index{days@{days}!crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}} \doxysubsubsection{\texorpdfstring{days}{days}} {\footnotesize\ttfamily \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_day}{Day}} crutchesbicycles.\+studyhelper.\+domain.\+Schedule\+Record.\+days\hspace{0.3cm}{\ttfamily [private]}} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a20120131bd6922a4a9b6c3027eab3e79}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a20120131bd6922a4a9b6c3027eab3e79}} \index{crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}!idScheduleRecord@{idScheduleRecord}} \index{idScheduleRecord@{idScheduleRecord}!crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}} \doxysubsubsection{\texorpdfstring{idScheduleRecord}{idScheduleRecord}} {\footnotesize\ttfamily long crutchesbicycles.\+studyhelper.\+domain.\+Schedule\+Record.\+id\+Schedule\+Record\hspace{0.3cm}{\ttfamily [private]}} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_aa0997abf176915a4a2b78246ff23983e}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_aa0997abf176915a4a2b78246ff23983e}} \index{crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}!pairs@{pairs}} \index{pairs@{pairs}!crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}} \doxysubsubsection{\texorpdfstring{pairs}{pairs}} {\footnotesize\ttfamily \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_pair}{Pair}} crutchesbicycles.\+studyhelper.\+domain.\+Schedule\+Record.\+pairs\hspace{0.3cm}{\ttfamily [private]}} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a1b77b1f0996f0d17d672272f3a2582f7}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a1b77b1f0996f0d17d672272f3a2582f7}} \index{crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}!schedule@{schedule}} \index{schedule@{schedule}!crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}} \doxysubsubsection{\texorpdfstring{schedule}{schedule}} {\footnotesize\ttfamily \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule}{Schedule}} crutchesbicycles.\+studyhelper.\+domain.\+Schedule\+Record.\+schedule\hspace{0.3cm}{\ttfamily [private]}} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a059247af08c825bff4b84d472c289bda}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a059247af08c825bff4b84d472c289bda}} \index{crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}!subjectEven@{subjectEven}} \index{subjectEven@{subjectEven}!crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}} \doxysubsubsection{\texorpdfstring{subjectEven}{subjectEven}} {\footnotesize\ttfamily \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}} crutchesbicycles.\+studyhelper.\+domain.\+Schedule\+Record.\+subject\+Even\hspace{0.3cm}{\ttfamily [private]}} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a760243f8223581a8185aea7197da4ce5}\label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_schedule_record_a760243f8223581a8185aea7197da4ce5}} \index{crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}!subjectOdd@{subjectOdd}} \index{subjectOdd@{subjectOdd}!crutchesbicycles.studyhelper.domain.ScheduleRecord@{crutchesbicycles.studyhelper.domain.ScheduleRecord}} \doxysubsubsection{\texorpdfstring{subjectOdd}{subjectOdd}} {\footnotesize\ttfamily \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}} crutchesbicycles.\+studyhelper.\+domain.\+Schedule\+Record.\+subject\+Odd\hspace{0.3cm}{\ttfamily [private]}} Объявления и описания членов класса находятся в файле\+:\begin{DoxyCompactItemize} \item /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/domain/\mbox{\hyperlink{_schedule_record_8java}{Schedule\+Record.\+java}}\end{DoxyCompactItemize} ======================= File: code_doc/latex/classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_file_upload_controller.tex ======================= \hypertarget{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_file_upload_controller}{}\doxysection{Класс crutchesbicycles.\+studyhelper.\+controller.\+File\+Upload\+Controller} \label{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_file_upload_controller}\index{crutchesbicycles.studyhelper.controller.FileUploadController@{crutchesbicycles.studyhelper.controller.FileUploadController}} \doxysubsection*{Функции с областью видимости пакета} \begin{DoxyCompactItemize} \item boolean \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_file_upload_controller_a648841fbaf306b5b3405ef7cb633c381}{save\+File}} (Multipart\+File file) \end{DoxyCompactItemize} \doxysubsection*{Закрытые данные} \begin{DoxyCompactItemize} \item String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_file_upload_controller_a43dff0decd5595233f5b31dbea4c3f17}{upload\+Path}} \end{DoxyCompactItemize} \doxysubsection{Методы} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_file_upload_controller_a648841fbaf306b5b3405ef7cb633c381}\label{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_file_upload_controller_a648841fbaf306b5b3405ef7cb633c381}} \index{crutchesbicycles.studyhelper.controller.FileUploadController@{crutchesbicycles.studyhelper.controller.FileUploadController}!saveFile@{saveFile}} \index{saveFile@{saveFile}!crutchesbicycles.studyhelper.controller.FileUploadController@{crutchesbicycles.studyhelper.controller.FileUploadController}} \doxysubsubsection{\texorpdfstring{saveFile()}{saveFile()}} {\footnotesize\ttfamily boolean crutchesbicycles.\+studyhelper.\+controller.\+File\+Upload\+Controller.\+save\+File (\begin{DoxyParamCaption}\item[{Multipart\+File}]{file }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [package]}} Сохраняет файл на внутреннем хранилиже \begin{DoxyParams}{Аргументы} {\em file} & -- уже обезопасен от колизий с помощью U\+U\+I\+D.\+random\+U\+U\+I\+D().to\+String() \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Возвращает} true/false в зависимости от результата сохранения файла \end{DoxyReturn} \doxysubsection{Данные класса} \mbox{\Hypertarget{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_file_upload_controller_a43dff0decd5595233f5b31dbea4c3f17}\label{classcrutchesbicycles_1_1studyhelper_1_1controller_1_1_file_upload_controller_a43dff0decd5595233f5b31dbea4c3f17}} \index{crutchesbicycles.studyhelper.controller.FileUploadController@{crutchesbicycles.studyhelper.controller.FileUploadController}!uploadPath@{uploadPath}} \index{uploadPath@{uploadPath}!crutchesbicycles.studyhelper.controller.FileUploadController@{crutchesbicycles.studyhelper.controller.FileUploadController}} \doxysubsubsection{\texorpdfstring{uploadPath}{uploadPath}} {\footnotesize\ttfamily String crutchesbicycles.\+studyhelper.\+controller.\+File\+Upload\+Controller.\+upload\+Path\hspace{0.3cm}{\ttfamily [private]}} Объявления и описания членов класса находятся в файле\+:\begin{DoxyCompactItemize} \item /\+Users/vgtstptlk/\+Desktop/МИРЭА/\+Study\+Helper/src/main/java/crutchesbicycles/studyhelper/controller/\mbox{\hyperlink{_file_upload_controller_8java}{File\+Upload\+Controller.\+java}}\end{DoxyCompactItemize} ======================= File: code_doc/latex/namespacecrutchesbicycles_1_1studyhelper_1_1security.tex ======================= <filename>code_doc/latex/namespacecrutchesbicycles_1_1studyhelper_1_1security.tex \hypertarget{namespacecrutchesbicycles_1_1studyhelper_1_1security}{}\doxysection{Пакет crutchesbicycles.\+studyhelper.\+security} \label{namespacecrutchesbicycles_1_1studyhelper_1_1security}\index{crutchesbicycles.studyhelper.security@{crutchesbicycles.studyhelper.security}} \doxysubsection*{Пакеты} \begin{DoxyCompactItemize} \item package \mbox{\hyperlink{namespacecrutchesbicycles_1_1studyhelper_1_1security_1_1jwt}{jwt}} \end{DoxyCompactItemize} \doxysubsection*{Классы} \begin{DoxyCompactItemize} \item class \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1security_1_1_user_detail_controller}{User\+Detail\+Controller}} \end{DoxyCompactItemize} ======================= File: code_doc/latex/classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material.tex ======================= \hypertarget{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material}{}\doxysection{Класс crutchesbicycles.\+studyhelper.\+domain.\+Group\+Material} \label{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material}\index{crutchesbicycles.studyhelper.domain.GroupMaterial@{crutchesbicycles.studyhelper.domain.GroupMaterial}} Граф наследования\+:crutchesbicycles.\+studyhelper.\+domain.\+Group\+Material\+:\begin{figure}[H] \begin{center} \leavevmode \includegraphics[height=2.000000cm]{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material} \end{center} \end{figure} \doxysubsection*{Открытые члены} \begin{DoxyCompactItemize} \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_a87096ffebb807ba33fc8e6695b12dcd4}{Group\+Material}} () \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group}{Group}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_a15cd749b3936e31a806ab62620a568df}{get\+Group}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_aa87d042b71598c3a25a4912a82d0c8ad}{set\+Group}} (\mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group}{Group}} \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_a73c0b0e061f55ecb8cb0304a92c46e13}{group}}) \item long \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_a170ce7a922c6c38875c47d8e228133ed}{get\+Id\+Material}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_aa624353c030de597d8421ab5e92edc54}{set\+Id\+Material}} (long \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_ad7b5d762b425a0c04578f8401f99e231}{id\+Material}}) \item List$<$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}} $>$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_a62a2107b2ccde1dfbd2b6b0b916bbd59}{get\+Subject}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_a5def22bf996ad44f5422cbcdbbf36415}{set\+Subject}} (List$<$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}} $>$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_aeeb741e3bb248c1e94ae9ad263290ced}{subject}}) \item String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_ae8249402d21d012085c11546e66c3920}{get\+Link\+To}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_a84162efcb9a0db4b76bdc25437811513}{set\+Link\+To}} (String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_acec115a7a5ad50b7ac8b011073657e64}{link\+To}}) \item String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_a660fe3947980e9c51bd52f76f504346a}{get\+File}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_ae663dc500f3ce50f2771f944d8c5527e}{set\+File}} (String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_aa0a4de7520921f3751346112e44ff7d3}{file}}) \item String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_a1a4e03b7de068c544d59b5558c023653}{get\+Caption}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_a2ba549d9a3a7273b7dd8d3b8a65e5da8}{set\+Caption}} (String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_a4f4020e0a18a7f20f90e23f828243664}{caption}}) \item String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_a3ab528a90abc1db260e37f66e24e961e}{get\+Description}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_a4ebf846f9907d62c54ce8f933bfb5ac4}{set\+Description}} (String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_a0d9f1f6927a8821af40f0b3cd182eff2}{description}}) \item List$<$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}} $>$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_a0f930ae0531ca04d442fe3ed8b9b240a}{get\+Label\+Subject}} () \item void \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_ae20d9c11091d3f46e96b22bdaf2199ae}{set\+Label\+Subject}} (List$<$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}} $>$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_a5de4fbcfb685688f48410fedeef6227e}{label\+Subject}}) \item \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_a5436e5a701fe75912a5134cc191fc3a5}{Group\+Material}} (List$<$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_subject}{Subject}} $>$ \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_aeeb741e3bb248c1e94ae9ad263290ced}{subject}}, String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_acec115a7a5ad50b7ac8b011073657e64}{link\+To}}, String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_aa0a4de7520921f3751346112e44ff7d3}{file}}, String \mbox{\hyperlink{classcrutchesbicycles_1_1studyhelper_1_1domain_1_1_group_material_a4f
70,304
thestackv1_concat_by_repo-long/65536-65536
Repo: smoers/fassicms ======================= File: public/css/all.css ======================= /* Company : Fassi Belgium Developed : MO-Consult Authority : Moers Serge Date : 09-10-20 */ .moco-layout-height{ min-height: 750px; } .moco-background{ background: url(../images/background.jpg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/background.jpg', sizingMethod=scale); -ms-filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/background', sizingMethod=scale); } .moco-color-error{ color: #CC0000!important; } .moco-color-success{ color: #007e33!important; } .moco-color-warning{ color: #ff8800!important; } .moco-color-info{ color: #0099cc!important; } .moco-color-bg-error{ background-color: #FC7474!important; } .moco-color-bg-warning{ background-color: #FEB058!important; } .moco-title{ font-family: monospace; font-weight: bold; font-size: 30px; } .moco-title-table{ color: #0099cc!important; font-weight: bold; } .moco-size-table { width: 400px; } .moco-size-column-table-100 { width: 100px; } .moco-size-column-table-150 { width: 150px; } .moco-size-column-table-200 { width: 200px; } .moco-size-column-table-250 { width: 250px; } .moco-size-column-table-300 { width: 300px; } .moco-size-column-table-350 { width: 350px; } .moco-size-column-table-400 { width: 400px; } .moco-row-table-font-small { font-size: small; } .moco-row-table-font-medium { font-size: medium; } .moco-row-table-font-large { font-size: large; } .moco-row-table-height-small { height: 5px; } .moco-row-highlight-table { background-color: #afd9ee; } .moco-error-small{ font-weight: bold; font-size: 12px; } .moco-scrollbar { position: relative; height: 700px; overflow: auto; } .moco-table-wrapper-scroll-y { display: block; } .moco-btn-sm { padding: 0.25rem 0.5rem; font-size: 10px; line-height: 1.5; border-radius: 0.2rem; } .moco-widget { border-radius: 10%; } #timedate { font: small-caps lighter 43px/150% "Segoe UI", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif; text-align:left; width: 50%; color: #FF8800; } @media (min-width: 992px){ .dropdown-menu.dropdown-toggle:after{ border-top:.3em solid transparent; border-right: 0; border-bottom:.3em solid transparent; border-left:.3em solid; } .dropdown-menu.dropdown-menu{ margin-left:0; margin-right: 0; } .dropdown-menu li{ position: relative; } .nav-item.submenu{ display: none; position: absolute; left:100%; top:-7px; } .nav-item.submenu-left{ right:100%; left:auto; } .dropdown-menu > li:hover{ background-color: #f1f1f1 } .dropdown-menu > li:hover >.submenu{ display: block; } } .primary-lighter-hover { color: #4285F4; -webkit-transition:.4s; transition:.4s; } .primary-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #8ab4f8; } .primary-darker-hover { color: #4285F4; -webkit-transition:.4s; transition:.4s; } .primary-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #0d5bdd; } .danger-lighter-hover { color: #ff3547; -webkit-transition:.4s; transition:.4s; } .danger-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #ff828d; } .danger-darker-hover { color: #ff3547; -webkit-transition:.4s; transition:.4s; } .danger-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #e80015; } .warning-lighter-hover { color: #FF8800; -webkit-transition:.4s; transition:.4s; } .warning-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #ffac4d; } .warning-darker-hover { color: #FF8800; -webkit-transition:.4s; transition:.4s; } .warning-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #b35f00; } .success-lighter-hover { color: #00C851; -webkit-transition:.4s; transition:.4s; } .success-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #16ff74; } .success-darker-hover { color: #00C851; -webkit-transition:.4s; transition:.4s; } .success-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #007c32; } .info-lighter-hover { color: #33b5e5; -webkit-transition:.4s; transition:.4s; } .info-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #77ceee; } .info-darker-hover { color: #33b5e5; -webkit-transition:.4s; transition:.4s; } .info-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #178ab4; } .default-lighter-hover { color: #2BBBAD; -webkit-transition:.4s; transition:.4s; } .default-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #5ad9cd; } .default-darker-hover { color: #2BBBAD; -webkit-transition:.4s; transition:.4s; } .default-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #1d7d73; } .secondary-lighter-hover { color: #aa66cc; -webkit-transition:.4s; transition:.4s; } .secondary-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #ca9fdf; } .secondary-darker-hover { color: #aa66cc; -webkit-transition:.4s; transition:.4s; } .secondary-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #8639ac; } .elegant-lighter-hover { color: #2E2E2E; -webkit-transition:.4s; transition:.4s; } .elegant-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #545454; } .elegant-darker-hover { color: #2E2E2E; -webkit-transition:.4s; transition:.4s; } .elegant-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #080808; } .unique-lighter-hover { color: #880e4f; -webkit-transition:.4s; transition:.4s; } .unique-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #cd1577; } .unique-darker-hover { color: #880e4f; -webkit-transition:.4s; transition:.4s; } .unique-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #430727; } .dark-green-lighter-hover { color: #388E3C; -webkit-transition:.4s; transition:.4s; } .dark-green-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #56bc5b; } .dark-green-darker-hover { color: #388E3C; -webkit-transition:.4s; transition:.4s; } .dark-green-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #225725; } .mdb-color-lighter-hover { color: #59698D; -webkit-transition:.4s; transition:.4s; } .mdb-color-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #8290b0; } .mdb-color-darker-hover { color: #59698D; -webkit-transition:.4s; transition:.4s; } .mdb-color-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #3b465e; } .red-lighter-hover { color: #D32F2F; -webkit-transition:.4s; transition:.4s; } .red-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #e06e6e; } .red-darker-hover { color: #D32F2F; -webkit-transition:.4s; transition:.4s; } .red-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #962020; } .pink-lighter-hover { color: #ec407a; -webkit-transition:.4s; transition:.4s; } .pink-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #f386aa; } .pink-darker-hover { color: #ec407a; -webkit-transition:.4s; transition:.4s; } .pink-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #cb1452; } .purple-lighter-hover { color: #8e24aa; -webkit-transition:.4s; transition:.4s; } .purple-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #b843d7; } .purple-darker-hover { color: #8e24aa; -webkit-transition:.4s; transition:.4s; } .purple-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #59176b; } .deep-purple-lighter-hover { color: #512da8; -webkit-transition:.4s; transition:.4s; } .deep-purple-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #7651d0; } .deep-purple-darker-hover { color: #512da8; -webkit-transition:.4s; transition:.4s; } .deep-purple-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #341d6c; } .indigo-lighter-hover { color: #3f51b5; -webkit-transition:.4s; transition:.4s; } .indigo-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #7280ce; } .indigo-darker-hover { color: #3f51b5; -webkit-transition:.4s; transition:.4s; } .indigo-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #2b387c; } .blue-lighter-hover { color: #1976D2; -webkit-transition:.4s; transition:.4s; } .blue-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #4e9cea; } .blue-darker-hover { color: #1976D2; -webkit-transition:.4s; transition:.4s; } .blue-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #11508e; } .light-blue-lighter-hover { color: #82B1FF; -webkit-transition:.4s; transition:.4s; } .light-blue-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #cfe1ff; } .light-blue-darker-hover { color: #82B1FF; -webkit-transition:.4s; transition:.4s; } .light-blue-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #3681ff; } .cyan-lighter-hover { color: #00bcd4; -webkit-transition:.4s; transition:.4s; } .cyan-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #22e6ff; } .cyan-darker-hover { color: #00bcd4; -webkit-transition:.4s; transition:.4s; } .cyan-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #007888; } .teal-lighter-hover { color: #00796b; -webkit-transition:.4s; transition:.4s; } .teal-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #00c6af; } .teal-darker-hover { color: #00796b; -webkit-transition:.4s; transition:.4s; } .teal-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #002d27; } .green-lighter-hover { color: #388E3C; -webkit-transition:.4s; transition:.4s; } .green-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #56bc5b; } .green-darker-hover { color: #388E3C; -webkit-transition:.4s; transition:.4s; } .green-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #225725; } .light-green-lighter-hover { color: #8bc34a; -webkit-transition:.4s; transition:.4s; } .light-green-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #b0d683; } .light-green-darker-hover { color: #8bc34a; -webkit-transition:.4s; transition:.4s; } .light-green-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #649130; } .lime-lighter-hover { color: #afb42b; -webkit-transition:.4s; transition:.4s; } .lime-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #d2d655; } .lime-darker-hover { color: #afb42b; -webkit-transition:.4s; transition:.4s; } .lime-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #73761c; } .yellow-lighter-hover { color: #fbc02d; -webkit-transition:.4s; transition:.4s; } .yellow-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #fcd778; } .yellow-darker-hover { color: #fbc02d; -webkit-transition:.4s; transition:.4s; } .yellow-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #d79b04; } .amber-lighter-hover { color: #ffa000; -webkit-transition:.4s; transition:.4s; } .amber-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #ffbd4d; } .amber-darker-hover { color: #ffa000; -webkit-transition:.4s; transition:.4s; } .amber-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #b37000; } .orange-lighter-hover { color: #f57c00; -webkit-transition:.4s; transition:.4s; } .orange-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #ffa243; } .orange-darker-hover { color: #f57c00; -webkit-transition:.4s; transition:.4s; } .orange-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #a95500; } .deep-orange-lighter-hover { color: #ff7043; -webkit-transition:.4s; transition:.4s; } .deep-orange-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #ffaa90; } .deep-orange-darker-hover { color: #ff7043; -webkit-transition:.4s; transition:.4s; } .deep-orange-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #f63b00; } .brown-lighter-hover { color: #795548; -webkit-transition:.4s; transition:.4s; } .brown-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #a57868; } .brown-darker-hover { color: #795548; -webkit-transition:.4s; transition:.4s; } .brown-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #49332b; } .grey-lighter-hover { color: #616161; -webkit-transition:.4s; transition:.4s; } .grey-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #878787; } .grey-darker-hover { color: #616161; -webkit-transition:.4s; transition:.4s; } .grey-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #3b3b3b; } .blue-grey-lighter-hover { color: #78909c; -webkit-transition:.4s; transition:.4s; } .blue-grey-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #a4b4bc; } .blue-grey-darker-hover { color: #78909c; -webkit-transition:.4s; transition:.4s; } .blue-grey-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #546973; } .white-lighter-hover { color: #fff; -webkit-transition:.4s; transition:.4s; } .white-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: white; } .white-darker-hover { color: #fff; -webkit-transition:.4s; transition:.4s; } .white-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: #d9d9d9; } .black-lighter-hover { color: #000; -webkit-transition:.4s; transition:.4s; } .black-lighter-hover:hover { -webkit-transition:.4s; transition:.4s; color: #262626; } .black-darker-hover { color: #000; -webkit-transition:.4s; transition:.4s; } .black-darker-hover:hover { -webkit-transition:.4s; transition:.4s; color: black; } ======================= File: public/3rd/bootstrap-checkbox-2.0.0/dist/js/i18n/tr.js ======================= <filename>public/3rd/bootstrap-checkbox-2.0.0/dist/js/i18n/tr.js (function ($) { Object.assign($.fn.checkboxpicker.defaults, { offLabel: 'Pasif', onLabel: 'Aktif', warningMessage: 'Lütfen label elementi içerisinde Bootstrap-checkbox kullanmayınız.' }); })(jQuery); ======================= File: public/js/moco.ajax.validation.js ======================= /* * Copyright (c) 2020. MO Consult * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Company : Fassi Belgium * Developer : MO Consult * Author : <NAME> * Date : 28/11/20 14:36 */ /** * Chargement des valeurs dans l'objet destiné à Ajax * @param objectFields * @returns {*} */ var loadValue = function(objectFields, index){ if (index == null) index = ""; $.each(objectFields, function (name,value){ objectFields[name] = $('#' + name + index).val(); }); return objectFields; } /** * * @param selector * @param value * @param url */ var mocoAjaxValidation = function (selector,value,url) { $.ajax({ url: url, type:"POST", data: value, success:function (response) { $(selector).removeClass('is-invalid').addClass('is-valid'); $(selector+'Error').text(""); }, error:function (response) { id = $(selector).attr('id'); message = response.responseJSON.errors[id.match(/[^\d]+/g)]; if(message == null) { $(selector).removeClass('is-invalid').addClass('is-valid'); $(selector+'Error').text(""); } else { $(selector).removeClass('is-valid').addClass('is-invalid'); $(selector + 'Error').text(message); } } }) } /** * Construit l'URL * * @param action * @returns {string} */ var mocoURL = function (action) { let result = action.match(/[^\/]+/g); let url = result[0]+'//'; for(let i=1;i<=result.length-2;i++){ url = url + result[i]+'/'; } return url; } /** * Exécuter au charge de la page */ $(function () { $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') } }); //Variable var validationArray = []; var validationFields = {}; var url = 'ajaxvalidation'; //Constructeur var element = $('input, select, form'); element.each(function (key, value) { if(element.eq(key).attr('moco-validation')!= null || element.eq(key).attr('moco-validation-table')!= null){ elementId = element.eq(key).attr('id'); if(element.eq(key).prop('tagName') == 'FORM'){ action = element.eq(key).attr('action'); url = mocoURL(action)+url; } else { validationArray[elementId] = 0; if (element.eq(key).attr('moco-validation')!= null) { validationFields[elementId] = ""; //object pour l'ajax request } else if (element.eq(key).attr('moco-validation-table')!= null) { validationFields[elementId.match(/[^\d]+/g)] = ""; } } } }); //Set event $('input').on('keyup', function(event){ targetId = (this.id); if(targetId!= "") { index = targetId.match(/\d+$/g); clearTimeout(validationArray[targetId]); validationArray[targetId] = setTimeout(mocoAjaxValidation, 1000, '#' + targetId, loadValue(validationFields, index), url); } }); }); ======================= File: public/js/moco.clock.js ======================= /* * Copyright (c) 2021. MO Consult * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Company : Fassi Belgium * Developer : MO Consult * Author : <NAME> * Date : 27/03/21 15:46 */ /* Global */ Number.prototype.pad = function(n) { for (var r = this.toString(); r.length < n; r = 0 + r); return r; }; function updateClock(language) { var now = new Date(); var sec = now.getSeconds(), min = now.getMinutes(), hou = now.getHours(), mo = now.getMonth(), dy = now.getDate(), yr = now.getFullYear(); var months = []; switch (language) { case 'en': months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; break; case 'fr': months = ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"]; break; case 'nl': months = ["Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December"]; break; } var tags = ["mon", "d", "y", "h", "m", "s"], corr = [months[mo], dy, yr, hou.pad(2), min.pad(2), sec.pad(2)]; for (var i = 0; i < tags.length; i++) document.getElementById(tags[i]).firstChild.nodeValue = corr[i]; } function initClock(language) { updateClock(language); window.setInterval(updateClock, 1000, language); } ======================= File: public/js/moco.selectpicker.js ======================= /* * Copyright (c) 2020. MO Consult * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Company : Fassi Belgium * Developer : MO Consult * Author : <NAME> * Date : 19/12/20 15:23 */ /** * * @type {{select: (function(*): {data: {subtext: string}, disabled: boolean, text: string, value: string}), data: [], preprocessData: (function(*=): []), log: number, language: string, locale: (function(): ({searchPlaceholder: string, currentlySelected: string, errorText: string, statusInitialized: string, emptyTitle: string, statusTooShort: string, statusNoResults: string, statusSearching: string}|undefined)), ajax: {data: string, dataType: string, type: string, url: string}, value: []}} */ var selectPickerOtions = { ajax : { url : '', type : 'POST', dataType: 'json', data : '', }, locale : {}, language : function(lg){ if(lg == 'fr') { /** * Traduction en français (defaut) */ this.locale = { currentlySelected: "Actuellement sélectionné", emptyTitle: "Sélectionnez et commencez à taper", errorText: "Impossible de récupérer les résultats", searchPlaceholder: "Chercher...", statusInitialized: "Commencez à taper une requête de recherche", statusNoResults: "Aucun résultat", statusSearching: "Recherche...", statusTooShort: "Veuillez saisir plus de caractères", } } else if(lg == 'nl'){ /** * Traduction en neerlandais */ this.locale = { currentlySelected: "Momenteel geselecteerd", emptyTitle: "Selecteer en begin met typen", errorText: "Resultaten kunnen niet worden opgehaald", searchPlaceholder: "Zoeken...", statusInitialized: "Begin met het typen van een zoekopdracht", statusNoResults: "Geen resultaat", statusSearching: "Zoeken...", statusTooShort: "Voer alstublieft meer karakters in", } } }, log : 3, /** * Retour de la requète Ajax */ _data : [], /** * Object avec les informations à afficher dans le select * @param obj * @returns {{data: {subtext: string}, disabled: boolean, text: string, value: string}} */ select : function(obj){ return { 'value': '', 'text': '', 'data': { 'subtext': '', }, 'disabled': false, } }, /** * */ _value: [], /** * Traitement des données avant l'utilisation dans le select * @param data * @returns {[]} */ preprocessData: function (data) { this.plugin.options._value = []; this.plugin.options._data = data; for(var i=0;i<data.length;i++){ this.plugin.options._value.push(this.plugin.options.select(data[i])); }; return this.plugin.options._value; } }; ======================= File: public/js/moco.request.js ======================= <reponame>smoers/fassicms /* * Copyright (c) 2021. MO Consult * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Company : Fassi Belgium * Developer : MO Consult * Author : <NAME> * Date : 28/03/21 18:16 */ /** * Requête ajax * @param data * @param url * @returns {Promise<*>} */ async function request(data, url){ const _get = await $.ajax({ url: url, data: data, }) return _get; } ======================= File: public/js/moco.redirect.js ======================= <reponame>smoers/fassicms /* * Copyright (c) 2020. MO Consult * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Company : Fassi Belgium * Developer : MO Consult * Author : <NAME> * Date : 23/12/20 16:49 */ /** * @param {string} options * @param {string} options.url * @param {string} options.method * @param {Object} options.data */ ;(function ($) { $.redirect = function(options) { if (typeof options === 'object') { var $form = $("<form />"); $form.attr("action",options.url); $form.attr("method",options.method); for (var data in options.data) $form.append('<input type="hidden" name="'+data+'" value="'+options.data[data]+'" />'); $("body").append($form); $form.submit(); } else { console.log('Le paramêtres doit être un objet') } } /** * Retourne l'objet avec les valeurs * * @param inputs * @returns {{}} */ $.redirect.data = function (inputs) { var obj = {} for(var input in inputs) obj[inputs[input]] = $('#' + inputs[input]).val(); return obj; } }(window.jQuery)) ======================= File: storage/framework/views/38413bc136cb1c465a248724c4cdd21e47ec5b1a.php ======================= <reponame>smoers/fassicms <?php $__env->startSection('content');?> <div class="container-fluid p-2 h-100 moco-layout-height"> <div class="container-fluid text-center mb-3"> <div class="moco-title brown-lighter-hover"><?php echo e(__('Technicians'));?></div> </div> <?php if (! isset($_instance)) { $html = \Livewire\Livewire::mount('technician.technician-list', [])->html(); } elseif ($_instance->childHasBeenRendered('GNXoe4B')) { $componentId = $_instance->getRenderedChildComponentId('GNXoe4B'); $componentTag = $_instance->getRenderedChildComponentTagName('GNXoe4B'); $html = \Livewire\Livewire::dummyMount($componentId, $componentTag); $_instance->preserveRenderedChild('GNXoe4B'); } else { $response = \Livewire\Livewire::mount('technician.technician-list', []); $html = $response->html(); $_instance->logRenderedChild('GNXoe4B', $response->id(), \Livewire\Livewire::getRootElementTagName($html)); } echo $html; ?> </div> <?php $__env->stopSection();?> <?php echo $__env->make('layouts.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render();?><?php /**PATH /var/www/moco/fassicms/resources/views/technician/technician-list.blade.php ENDPATH**/?> ======================= File: resources/views/auth/login.blade.php ======================= <reponame>smoers/fassicms<filename>resources/views/auth/login.blade.php <!-- Company : Fassi Belgium Developed : MO-Consult Authority : Moers Serge Date : 27-10-20 --> @extends('layouts.layout') @section('content') <div id="loginmodal" class="modal" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false"> <div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-content"> <div class="modal-header"> <div class="container-fluid w-100"> <div class="d-flex justify-content-between"> <div class="p-2"><img src="./images/logo.png"></div> <div class="p-2"> <select id="lang" class="form-control-sm"> <option value="en" @if($cookie == 'en') selected @endif>EN</option> <option value="fr" @if($cookie == 'fr') selected @endif>FR</option> <option value="nl" @if($cookie == 'nl') selected @endif>NL</option> </select> </div> </div> <div class="d-flex justify-content-center"> <div class="p-2 blue-darker-hover" style="font-size: 34px; font-weight: bold; font-style: italic">Stock Management System</div> </div> </div> </div> <div class="modal-body"> <form method="POST" action="{{ route('login') }}"> @csrf <div class="form-group row"> <label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label> <div class="col-md-6"> <input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus> @error('email') <span class="invalid-feedback" role="alert"> <strong>{{ $message }}</strong> </span> @enderror </div> </div> <div class="form-group row"> <label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label> <div class="col-md-6"> <input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="current-password"> @error('password') <span class="invalid-feedback" role="alert"> <strong>{{ $message }}</strong> </span> @enderror </div> </div> <!-- <div class="form-group row"> <div class="col-md-6 offset-md-4"> <div class="form-check"> <input class="form-check-input" type="checkbox" name="remember" id="remember" {{ old('remember')? 'checked' : '' }}> <label class="form-check-label" for="remember"> {{ __('Remember Me') }} </label> </div> </div> </div> --> <div class="form-group row mb-0"> <div class="col-md-8 offset-md-4"> <button type="submit" class="btn btn-primary"> {{ __('Login') }} </button> <!-- @if (Route::has('password.request')) <a class="btn btn-link" href="{{ route('password.request') }}"> {{ __('Forgot Your Password?') }} </a> @endif --> </div> </div> </form> </div> <div class="modal-footer d-flex justify-content-center"> <div>Developed by MO Consult <i class="fas fa-copyright"></i> {{ date('Y') }}</div> </div> </div> </div> </div> <script type="text/javascript" src="{{ asset('js/moco.redirect.js') }}"></script> <script> $(document).ready(function(){ /** Ouverture du formulaire de connexion en mode modal **/ $('#loginmodal').modal('show'); /** cookie pour la langue **/ $('#lang').on('change',function(){ let data = []; data['_token'] = $('meta[name="csrf-token"]').attr('content'); data['lg'] = $('#lang').val(); $.redirect({ url: '{{ route('login.setcookie') }}', method: 'post', data: data, }); }); }); </script> @endsection ======================= File: storage/framework/views/2df3853ad3264b5110fac6a9a9019214070b3bd2.php ======================= <div class="row mb-3"> <div class="d-flex justify-content-start"> <div class="custom-control custom-switch"> <input wire:model="edit" class="custom-control-input" type="checkbox" id="edit"> <label class="custom-control-label" for="edit"><?php echo e(__('Edit'));?></label> </div> <button type="submit" class="btn btn-primary moco-btn-sm" wire:click='submit' <?php if(!$edit):?> disabled <?php endif;?> ><?php echo e(__('Save'));?></button> </div> </div> <?php /**PATH /var/www/moco/fassicms/resources/views/livewire/provider/provider-list-head.blade.php ENDPATH**/?> ======================= File: resources/views/menus/list-submenu.blade.php ======================= <gh_stars>0 <div class="container-fluid"> @if($whatIs == 'crane') @var $_modify = route('crane.edit',$crane->id) @var $_show = route('crane.show',$crane->id) @var $_remove = '' @var $_print = '' @var $_print_id = '' @var $_r_modify = true @elseif($whatIs == 'customer') @var $_modify = route('customer.edit',$customer->id) @var $_show = route('customer.show',$customer->id) @var $_export = '' @var $_remove = '' @var $_print = '' @var $_print_id = '' @var $_r_modify = true @elseif($whatIs == 'technician') @var $_modify = route('technician.edit',$technician->id) @var $_show = route('technician.show',$technician->id) @var $_export = '' @var $_remove = '' @var $_print = '' @var $_print_id = '' @var $_r_modify = true @elseif($whatIs == 'worksheet') @var $_modify = route('worksheet.edit',$worksheet->id) @var $_show = route('worksheet.show',$worksheet->id) @var $_export = route('worksheet.export',$worksheet->id) @var $_remove = '' @var $_hour = route('clocking.edit',$worksheet->id) @var $_part = route('worksheet.part',$worksheet->id) @var $_print = route('worksheet.print') @var $_print_id = $worksheet->id @var $_r_modify =!$worksheet->validated @endif <div class="d-flex justify-content-md-end justify-content-sm-end justify-content-lg-end" style="height: auto"> @if($_r_modify) @canany(['edit customer','edit crane','edit technician','edit worksheet']) <div class="ml-2"><a href="{{ $_modify }}" class="btn btn-primary moco-btn-sm"><i class="fas fa-edit" style="color: white!important;"></i> {{trans('Modify')}}</a></div> @endcanany @endif @if($whatIs == 'worksheet') @can('clocking worksheet')<div class="ml-2"><a href="{{ $_hour }}" class="btn btn-info moco-btn-sm"><i class="fas fa-clock" style="color: white!important;"></i> {{trans('Hours')}}</a></div>@endcan @can('part worksheet')<div class="ml-2"><a href="{{ $_part }}" class="btn btn-info moco-btn-sm"><i class="fas fa-clock" style="color: white!important;"></i> {{trans('Parts')}}</a></div>@endcan @else @canany(['consult customer','consult crane','consult technician']) <div class="ml-2"><a href="{{ $_show }}" class="btn btn-info moco-btn-sm"><i class="fas fa-eye" style="color: white!important;"></i> {{trans('Show')}}</a></div> @endcanany @endif @canany(['consult worksheet','print worksheet']) <div class="ml-2"> <a class="nav-link dropdown-toggle btn btn-secondary moco-btn-sm" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Plus</a> <div class="dropdown-menu"> @if($whatIs == 'worksheet') @can('consult worksheet')<a class="dropdown-item moco-color-info moco-error-small" href="{{ $_show }}"><i class="fas fa-eye"></i> {{trans('Show')}} </a>@endcan @can('consult worksheet')<a class="dropdown-item moco-color-info moco-error-small" href="{{ $_export }}"><i class="fas fa-file-export"></i> {{__('Export')}} </a>@endcan @endif <!-- <a class="dropdown-item moco-color-error moco-error-small" href="{{ $_remove }}"><i class="fas fa-trash-alt"></i> {{trans('Remove')}} </a> --> @can('print worksheet')<a class="dropdown-item moco-color-info moco-error-small print_id" href="{{ $_print }}" id="print_{{$_print_id}}"><i class="fas fa-print"></i> {{trans('Print')}} </a>@endcan </div> </div> @endcanany </div> </div> ======================= File: storage/framework/views/90c48dcb194d2bb220a0b74a2b7047854d23d0fb.php ======================= <!-- Company : Fassi Belgium Developed : MO-Consult Authority : Moers Serge Date : 27-10-20 --> <!DOCTYPE html> <html lang="<?php echo e(str_replace('_', '-', app()->getLocale()));?>" <?php if(! \Illuminate\Support\Facades\Auth::check()):?> class="moco-background" <?php endif;?>> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="csrf-token" content="<?php echo e(csrf_token());?>"> <title>Fassi Belgium CMS</title> <link href="<?php echo e(asset('/images/favicon.ico'));?>" rel="shortcut icon" type="image/vnd.microsoft.icon" /> <!-- Font Awesome --> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css"> <!-- Google Fonts --> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"> <!-- Bootstrap core CSS --> <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css" rel="stylesheet"> <!-- Material Design Bootstrap --> <link href="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.19.1/css/mdb.min.css" rel="stylesheet"> <!-- Datepicker --> <link href="<?php echo e(asset('3rd/bootstrap-datepicker-1.9.0-dist/css/bootstrap-datepicker3.standalone.css'));?>" rel="stylesheet"> <!-- Bootstrap-Select --> <link href="<?php echo e(asset('3rd/bootstrap-select-1.13.18/css/bootstrap-select.min.css'));?>" rel="stylesheet"> <!-- Ajax Bootstrap Select--> <link href="<?php echo e(asset('3rd/Ajax-Bootstrap-Select-1.4.5/dist/css/ajax-bootstrap-select.min.css'));?>" rel="stylesheet"> <link href="<?php echo e(asset('3rd/bttn.css-v0.2.4/bttn.css'));?>" rel="stylesheet"> <!-- iziToast --> <link href="<?php echo e(asset('3rd/iziToast-master/dist/css/iziToast.min.css'));?>" rel="stylesheet"> <!-- CSS MOCO --> <link href="<?php echo e(asset('css/all.css'));?>" rel="stylesheet" type="text/css"> <!-- JQuery --> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <!-- Bootstrap tooltips --> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.4/umd/popper.min.js"></script> <!-- Bootstrap core JavaScript --> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/js/bootstrap.min.js"></script> <!-- MDB core JavaScript --> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.19.1/js/mdb.min.js"></script> <!-- Datepicker--> <script src="<?php echo e(asset('3rd/bootstrap-datepicker-1.9.0-dist/js/bootstrap-datepicker.min.js'));?>"></script> <!-- Bootstrap-Select --> <script type="text/javascript" src="<?php echo e(asset('3rd/bootstrap-select-1.13.18/js/bootstrap-select.min.js'));?>"></script> <!-- Ajax Bootstrap Select --> <script type="text/javascript" src="<?php echo e(asset('3rd/Ajax-Bootstrap-Select-1.4.5/dist/js/ajax-bootstrap-select.min.js'));?>"></script> <!-- Handlebars--> <script type="text/javascript" src="<?php echo e(asset('3rd/handlebars-v4.7.6/handlebars-v4.7.6.js'));?>"></script> <!-- Moment--> <script type="text/javascript" src="<?php echo e(asset('3rd/moment.2.91.1/moment.min.js'));?>"></script> <!-- iziToast --> <script type="text/javascript" src="<?php echo e(asset('3rd/iziToast-master/dist/js/iziToast.min.js'));?>"></script> <!-- Moco --> <script type="text/javascript" src="<?php echo e(asset('js/moco.request.js'));?>"></script> <script type="text/javascript" src="<?php echo e(asset('js/moco.random.js'));?>"></script> <!-- Livewire --> <?php echo \Livewire\Livewire::styles();?> </head> <body> <!-- affichez uniquement si l'utilisateur est authentifié --> <?php if(\Illuminate\Support\Facades\Auth::check()):?> <?php echo $__env->make('menus.navbar', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render();?> <?php echo $__env->make('auth.change', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render();?> <?php endif;?> <div class="container-fluid"> <?php echo $__env->make('root.message', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render();?> <?php echo $__env->yieldContent('content');?> </div> <!-- affichez uniquement si l'utilisateur est authentifié --> <?php if(\Illuminate\Support\Facades\Auth::check()):?> <div class="d-flex justify-content-center"> <div>Developed by MO Consult <i class="fas fa-copyright"></i> <?php echo e(\Carbon\Carbon::now()->year);?></div> </div> <?php endif;?> <?php echo \Livewire\Livewire::scripts();?> </body> </html> <?php /**PATH /var/www/moco/fassicms/resources/views/layouts/layout.blade.php ENDPATH**/?> ======================= File: resources/views/widgets/stock_info.blade.php ======================= <gh_stars>0 @extends('widgets.template') @section('body') <div class="d-flex flex-sm-row"> <div class="d-flex flex-sm-column mr-2"> <img src="{{asset('images/stock-48.png')}}"> </div> <div class="d-flex flex-sm-column"> <div>{{__('Spares to restock')}}: {{$config['count']}}</div> <a href="{{$config['report']}}" class="btn btn-success moco-btn-sm">{{__('Show report')}}</a> </div> </div> @endsection ======================= File: app/Http/Livewire/Reassort/ReassortListHead.php ======================= <?php namespace App\Http\Livewire\Reassort; use Livewire\Component; class ReassortListHead extends Component { public $locationId = null; public function mount() { $this->locationId = config('moco.reassort.defaultLocation'); } public function render() { $this->emit('headerChange',$this->locationId); return view('livewire.reassort.reassort-list-head'); } } ======================= File: app/Moco/Common/MocoFormRequestAjaxValidation.php ======================= <?php /* * Copyright (c) 2020. MO Consult * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Company : Fassi Belgium * Developer : MO Consult * Author : <NAME> * Date : 5/12/20 17:32 */ /** * Company : Fassi Belgium * Developer : MO Consult * Authority : <NAME> * Date : 05-12-20 */ namespace App\Moco\Common; trait MocoFormRequestAjaxValidation { public $requestArray; /** * @param array $request */ public function setRequestArray(array $requestArray): void { $this->requestArray = $requestArray; } /** * @return array */ public function getRequestArray() { return $this->requestArray; } } ======================= File: storage/framework/views/26a61ab7fb891f7a3c682b06ecd23a8fb3088c7f.php ======================= <?php $__env->startSection('content');?> <div class="container p-5 h-100 moco-layout-height" style="min-width: 50vw"> <div class="card"> <div class="card-header text-center font-weight-bold"> <h2 class="blue-grey-darker-hover"><?php echo e($title);?></h2> </div> <div class="card-body"> <div class="d-flex justify-content-around"> <div class="d-flex justify-content-center align-self-center"> <span class="align-self-center"><?php echo e(__('Number of worksheet'));?> :</span> <span class="align-self-center"><input type="number" id="nbr" name="nbr" class="form-control ml-3" value="0"></span> </div> <div class="align-self-center"><a href="#" class="btn btn-danger" id="launch"><?php echo e(__('Launch'));?></a></div> </div> <form name="template-form" id="template-form" method="post" action="<?php echo e(route('worksheet.template.store'));?>"> <?php echo csrf_field();?> <table class="table table-sm table-striped mt-5"> <tbody id="addRow"> </tbody> </table> <div hidden id="wait" class="text text-danger"><?php echo e(__('Please wait...'));?></div> <div hidden class="d-flex justify-content-between save"> <div hidden class="save"> <button type="submit" class="btn btn-primary"><?php echo e(__('Save'));?></button> </div> <div hidden class="save"> <a href="<?php echo e(route('worksheet.index'));?>" class="btn btn-primary"><?php echo e(__('Cancel'));?></a> </div> </div> </form> </div> </div> </div> <script id="document-template" type="text/x-handlebars-template"> <tr><td><input type="text" readonly class="form-control form-control-sm bg-white" name="number[]" value="{{ number }}"/></td></tr> </script> <script type="text/javascript"> /** constante avec la function permettant de générer un delai**/ const delay = (n) => new Promise( r => setTimeout(r, n*1000)); $(function () { /** tableau avec la liste des numéros de worksheet**/ var _number_array = []; /** event sur le bouton launch **/ $('#launch').on('click',async () => { /** récupère le nombre de worksheet number à créer **/ let _nbr = parseInt($('#nbr').val()); if (_nbr > 0) { /** cache le bouton launch **/ $('#launch').attr('hidden','hidden'); /** affiche le message d'attente **/ $('#wait').removeAttr('hidden'); /** génère template pour la librairie Handlebars **/ let template = Handlebars.compile($('#document-template').html()); /** on boucle pour générer les numéros **/ for (let i = 1; i <= _nbr; i++) { _number_array[i] = moment().format('YYYYMMDDHHmmss'); $('#addRow').append(template({number: _number_array[i]})); await delay(2); } /** cache le message d'attente **/ $('#wait').attr('hidden','hidden'); $('.save').removeAttr('hidden'); } }); }) /** permet de créer un moment d'attente **/ async function wait(){ await delay(2); } </script> <?php $__env->stopSection();?> <?php echo $__env->make('layouts.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render();?><?php /**PATH /var/www/moco/fassicms/resources/views/worksheet/worksheet-template-create.blade.php ENDPATH**/?> ======================= File: storage/framework/views/cff6911a63b7c74255db53c8c09f02ebc6382986.php ======================= <div class="card mb-3"> <div class="card-header text-center font-weight-bold"> <h2 class="blue-grey-darker-hover"><?php echo e(__('Reassortment List'));?></h2> </div> <div class="card-body" style="font-size: 12px"> <?php if (! isset($_instance)) { $html = \Livewire\Livewire::mount('reassort-level.reassort-level-list', [])->html(); } elseif ($_instance->childHasBeenRendered('VrHmuJW')) { $componentId = $_instance->getRenderedChildComponentId('VrHmuJW'); $componentTag = $_instance->getRenderedChildComponentTagName('VrHmuJW'); $html = \Livewire\Livewire::dummyMount($componentId, $componentTag); $_instance->preserveRenderedChild('VrHmuJW'); } else { $response = \Livewire\Livewire::mount('reassort-level.reassort-level-list', []); $html = $response->html(); $_instance->logRenderedChild('VrHmuJW', $response->id(), \Livewire\Livewire::getRootElementTagName($html)); } echo $html; ?> </div> </div> <?php /**PATH /var/www/moco/fassicms/resources/views/store/reassort-level-list.blade.php ENDPATH**/?> ======================= File: app/Moco/Common/MocoModelForConsult.php ======================= <filename>app/Moco/Common/MocoModelForConsult.php <?php /* * Copyright (c) 2021. MO Consult * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Company : Fassi Belgium * Developer : MO Consult * Author : <NAME> * Date : 24/05/21 12:53 */ /** * Company : Fassi Belgium * Developer : MO Consult * Authority : <NAME> * Date : 24-05-21 */ namespace App\Moco\Common; use Carbon\Carbon; use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\Schema; /** * Cette classe se charge de l'affichage en mode consultation * des modèles * * Class MocoModelForConsult * @package App\Moco\Common */ class MocoModelForConsult { protected $model = null; protected $extended; protected $item_layout = '<tr class="moco-row-table-font-small"><td class="moco-color-info" style="font-style: italic; width: 25%">{{$key}}</td><td>{{$value}}</td></tr>'; protected $header_layout = '<table class="table table-sm"><thead class="thead-light"><tr><th>Fields</th><th>Values</th></tr></thead><tbody>{{$item}}</tbody></table>'; protected $collapse_href = '<a class="btn btn-primary" data-toggle="collapse" href="#{{$randomkey}}" role="button" aria-expanded="false" aria-controls="{{$randomkey}}">{{$relation}} <i class="fas fa-caret-right"></i></a>'; protected $collapse_content = '<div class="collapse" id="{{$randomkey}}">{{$table}}</div>'; protected $follow = []; /** * Constructeur * * @param MocoModelForConsultInterface $model * @param bool $extended */ public function __construct(MocoModelForConsultInterface $model, bool $extended = true) { $this->model = $model; $this->extended = $extended; $this->follow = config('moco.consult.follow'); } /** * Retourne le contenu HTML à passer à la vue * qui se charge de l'affichage * * @return string|null */ public function getBladeLayout():? string { return $this->getBladeLayoutModel(); } /** * Retourne le contenu HTML en chassé dans une balise <TABLE> * * @return string|null */ protected function getBladeLayoutModel():?string { return $this->insertTable($this->getBladeLayoutModelExtended()); } /** * Construit le HTML * * @return String|null */ protected function getBladeLayoutModelExtended():?String { $layout = $this->getAttributesLayoutRow($this->model); if ($this->extended) $layout.= $this->getBladeLayoutRelations(); return $layout; } /** * Retourne le HTML des relations du modele principal * * @return string|null */ protected function getBladeLayoutRelations():?string { $layout = ''; /** * pour chaque relation fournie par la méthode WithForConsult * on recherche les données du ou des modèles liés */ foreach ($this->model->WithForConsult() as $relation){ if ($this->model->$relation instanceof Collection){ /** * le layout temporaire avant de l'insérer dans * le layout définitif */ $layoutTemp = ''; /** * si la relation retourne une collection, il faut la parcourir */ foreach ($this->model->$relation->all() as $model){ /** * on défini la clé pour le collapse */ $randomKey = 'k'.Moco::randomKey(); if (!is_null($model->id)) $idKey = $model->id; else $idKey = '?'; $layoutTemp.= $this->insertRow( $this->insertCollapseHref($randomKey,$idKey), $this->insertCollapseContent($randomKey,$this->getAttributesLayoutTable($model)) ); } /** * on défini la clé pour le collapse */ $randomKey = 'k'.Moco::randomKey(); $layout.= $this->insertRow( $this->insertCollapseHref($randomKey,$relation), $this->insertCollapseContent($randomKey,$this->insertTable($layoutTemp)) ); } else { /** * on défini la clé pour le collapse */ $randomKey = 'k'.Moco::randomKey(); $model = $this->model->$relation; $layout.= $this->insertRow( $this->insertCollapseHref($randomKey,$relation), $this->insertCollapseContent($randomKey,$this->getAttributesLayoutTable($model)) ); } } return $layout; } /** * Construit une ligne du tableau par attributs du modèle * * @param Model $model * @return string|null */ protected function getAttributesLayoutRow(Model $model):?string { $layout = ''; $table_name = $model->getTable(); foreach ($model->getAttributes() as $key => $value){ if ($this->getField($table_name.'.show.'.$key,true)) { $_name = $this->getField($table_name. '.name.'. $key, $key); if (array_key_exists($key,$this->follow)){ $_value = $this->getFollowLink($model,$this->follow[$key]); } else { $_value = $this->valueConverter($table_name, $key, $value); } $layout.= $this->insertRow(trans($_name), $_value); } } return $layout; } /** * En chasse les lignes avec les attributs dans une balise <TABLE> * * @param Model $model * @return string|null */ protected function getAttributesLayoutTable(Model $model):?string { return $this->insertTable($this->getAttributesLayoutRow($model)); } /** * Insère les valeurs dans les balises HTML de basses * * @param string|null $key * @param string|null $value * @return string|null */ protected function insertRow(?string $key,?string $value):?string { return str_replace(['{{$key}}','{{$value}}'],[$key,$value],$this->item_layout); } /** * Insère les balises HTML de basses dans les balises du tableau de basses * * @param string|null $item * @return string|null */ protected function insertTable(?string $item):?string { return str_replace('{{$item}}',$item,$this->header_layout); } protected function insertCollapseHref(string $randomKey, string $relation) { return str_replace(['{{$randomkey}}','{{$relation}}'],[$randomKey,trans(ucfirst($relation))],$this->collapse_href); } protected function insertCollapseContent(string $randomKey, string $table) { return str_replace(['{{$randomkey}}','{{$table}}'],[$randomKey,$table],$this->collapse_content); } /** * Obtenir les infos depuis le fichier de configuration * * @param string $key * @return \Illuminate\Config\Repository|\Illuminate\Contracts\Foundation\Application|mixed */ protected function getField(string $key, $default = null) { return config('moco.consult.fields.'.$key,$default); } /** * Converti une valeur * * @param string $table_name * @param string $field * @param $value * @return mixed|string */ protected function valueConverter(string $table_name, string $field, $value) { switch (Schema::getColumnType($table_name, $field)){ case 'boolean': $value = $value == 1? trans('Yes') : trans('No'); break; case 'decimal': $value = number_format(intval($value),2,',',''); break; case 'datetime': $value = Carbon::parse($value)->format('d/m/Y H:i'); break; } return $value; } /** * Cette méthode permet de récupérer des informations spécifiées dans le fichier de configuration * depuis les relations du modèle principal * * 'consult' => [ * 'follow' => [ * 'location_id' => 'location:location|description', * 'provider_id' => 'provider:name', * 'user_id' => 'user:firstname|lastname', * 'customer_id' => 'customer:name|address|zipcode|city|country', * 'crane_id' => 'crane:serial|model|plate', * ], * * @param Model $model * @param string $follow * @return string|null */ protected function getFollowLink(Model $model, string $follow) { $content = null; $follows = explode(':',$follow); $relation = $follows[0]; $list_fields = explode('|',$follows[1]); $relation_model = $model->{$relation}()->first(); foreach ($list_fields as $field){ $content.= (!is_null($content)? '</br>' : '').$relation_model->getAttribute($field); } return $content; } } ======================= File: app/Http/Controllers/ClockingController.php ======================= <reponame>smoers/fassicms <?php /* * Copyright (c) 2021. MO Consult * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Company : Fassi Belgium * Developer : MO Consult * Author : <NAME> * Date : 6/02/21 09:22 */ namespace App\Http\Controllers; use App\Moco\Common\Moco; use App\Models\Clocking; use App\Models\ClockingsDetails; use App\Models\Technician; use App\Models\ViewClockingsDetailsCorrect; use Carbon\Carbon; use Illuminate\Database\Eloquent\Collection; use Illuminate\Http\Request; use App\Models\Worksheet; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; class ClockingController extends Controller { private $action = null; private $status = null; /** * ClockingController constructor. */ public function __construct() { $this->action = config('moco.clocking.actions'); $this->status = config('moco.clocking.status'); } /** * Edition et ajout de prestations sur une fiche de travail * * @param $id * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View */ public function edit($id) { $worksheet = Worksheet::find($id); return view('worksheet.clocking-form',[ 'action' => route('clocking.update',$id), 'technicians' => Technician::all()->sortBy('lastname'), 'worksheet' => $worksheet, 'clockings' => $worksheet->clockings, ]); } /** * Ouvre le formulaire avec la liste des pointages jour-1 non cloturés * * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View */ public function correct() { $clockings = ViewClockingsDetailsCorrect::where('status','=',$this->status['activated'])->get(); return view('worksheet.clockings-details-correct-list',[ 'clockings' => $clockings, ]); } /** * Sauvegarde les prestations * * @param Request $request * @param $id * @return \Illuminate\Http\RedirectResponse */ public function update(Request $request, $id) { /** * Collection des objet Clocking avant modification */ $currentClockings = Clocking::where('worksheet_id','=',$id)->get(); /** * Ce tableau va contenir les objet qui ont été mis à jour */ $updateClockings = new Collection(); /** * Tableau qui va contenir les objets Clocking a sauvegarder */ $clockings = array(); /** * Récupère le tableau des imputs */ $input = $request->all(); if (array_key_exists('technician_id',$input)) { /** * On parcours le tableau des valeurs récupérée */ foreach ($input['technician_id'] as $key => $technician_id) { /** * Est ce un nouvelle enregistrement ou la modification d'un existant */ if (is_null($input['id'][$key])) { $clocking = new Clocking(); } else { $clocking = Clocking::find($input['id'][$key]); /** * L'objet Clocking ayant été mis à jour on le conserve */ $updateClockings->push($clocking); } /** * Hydrate l'objet Clocking */ $clocking->technician_id = $technician_id; $clocking->worksheet_id = $id; $clocking->setDateAttribute($input['start_date'][$key]); $clocking->setStartDateTime($input['start_date'][$key], $input['start_time'][$key]); $clocking->setStopDateTime($input['start_date'][$key], $input['stop_time'][$key]); $clocking->user()->associate(Auth::user()); array_push($clockings, $clocking); } /** * On sauvegarde les modifications et les nouveaux records */ foreach ($clockings as $clocking) { $clocking->save(); } } /** * Récupére la collection des objets qui n'ont pas été mis à jour * cela signifie qu'ils doivent être supprimé */ $deleteClockings = $currentClockings->diff($updateClockings); foreach ($deleteClockings as $deleteClocking) { $deleteClocking->delete(); } return redirect()->route('worksheet.index')->with('success', trans('The clockings has been saved with success')); } public function show($id) { dd(Clocking::find($id)->technician); } /** * formulaire de pointage des techniciens * * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View */ public function ClockingTechnician() { return view('worksheet.clocking-technician-form'); } /** * Répond à la requête ajax permettant de savoir si le numéro de fiche de travail * existe et son status de validation * @param Request $request * @return \Illuminate\Http\JsonResponse */ public function ajaxWorksheetCheck(Request $request) { return response()->json(Moco::worksheetCheck($request)); } public function ajaxTechnicianCheck(Request $request) { /** * Recherche le technicien */ $technician = Technician::getTechnician($request->tec_number); /** * Recherche la fiche de travail */ $worksheet = Worksheet::find($request->worksheet_id); if (!is_null($technician)){ /** * contrôle s'il n'y a pas un clocking en 'action' 'T' et'status' 'A' pour ce technicien * sur une autre fiche de travail */ $clocking_detail = ClockingsDetails::getStartClocking($worksheet,$technician,'<>'); if (!is_null($clocking_detail)){ /** * Si un enregistrement est trouvé on retourne une erreur */ $worksheet = Worksheet::find($clocking_detail->worksheet_id); $result = [ 'checked' => false, 'msg' => trans("A start clocking has already initiated for a worksheet $worksheet->number. Please stop this one before to start another." ), ]; } else { /** * Existe-t-il un enregistrement de départ */ $clocking_detail_start = ClockingsDetails::getStartClocking($worksheet, $technician); if (is_null($clocking_detail_start)) { /** * Pas d'enregistrement de départ donc on le crée */ $clocking_detail_start = ClockingsDetails::setStartClocking($worksheet, $technician); $result = [ 'checked' => true, 'msg' => trans("$technician->firstname, a start clocking has been initiated at $clocking_detail_start->date_time for the worksheet : $worksheet->number"), ]; } else { /** * il y a un enregistrement de départ donc on crée un enregistrement de sortie */ $clocking_detail_stop = ClockingsDetails::setStopClocking($worksheet, $technician); /** * Enregistrement du Clocking */ $clocking = Clocking::setClocking($clocking_detail_start, $clocking_detail_stop); $result = [ 'checked' => true, 'msg' => trans("$technician->firstname, a stop clocking has been initiated at $clocking_detail_stop->date_time for the worksheet : $worksheet->number </br>You have a total of ".$clocking->getDiff()), ]; } } } else { $result = [ 'checked' => false, 'msg' => trans('This technician does not exist or is disabled'), ]; } return response()->json($result); } /** * Enregistre une correction suite à une prestation non clôturée * * @param Request $request */ public function ajaxCorrect(Request $request) { $result = [ 'status' => false, 'msg' => null, ]; /** * récupère l'enregistrement de début */ $start = ClockingsDetails::find($request->id); /** * Fin de prestation ou suppression */ if ($request->whyis == 'closed') { /** * a-t-il été trouvé? */ if (!is_null($start)) { /** * Contrôle la validité de la valeur introduite */ if ($request->stop_time!= '') { $start_time = Carbon::createFromTimeString($start->getTime()); $stop_time = Carbon::createFromTimeString($request->stop_time); /** * S'assure que la valeur de fin est supérieur à la valeur de début */ if ($start_time->lessThan($stop_time)) { /** * On crée l'enregistrement la fin de prestation */ $worksheet = Worksheet::find($start->worksheet_id); $technician = Technician::find($start->technician_id); $stop = new ClockingsDetails(); $stop->date = $start->getDate(); $stop->setDateTime($start->getDate(), $request->stop_time); $stop->action = $this->action['stop']; $stop->status = $this->status['activated']; $stop->worksheet()->associate($worksheet); $stop->technician()->associate($technician); $stop->user()->associate(Auth::user()); $stop->save(); /** * On crée l'enregistrement de la prestation complète dans la table Clockings */ $clocking = Clocking::setClocking($start, $stop); $result['status'] = true; $result['msg'] = trans('The stop time has been correctly saved'); } else { $result['msg'] = trans('The stop time value is less than the start time value'); } } else { $result['msg'] = trans('The time value is not correct'); } } } elseif ($request->whyis =='removed') { if (!is_null($start)){ $start->status = $this->status['deleted']; $start->user()->associate(Auth::user()); $start->save(); $result['status'] = true; $result['msg'] = trans('This start clocking has been flagged as deleted'); } else { $result['msg'] = trans('This start clocking cannot be flagged as deleted, see with your administrator'); } } return response()->json($result); } } ======================= File: storage/framework/views/e5afa8da98d4be0dfd232020221573d672f22635.php ======================= <div class="d-flex justify-content-start"> <button class="btn btn-danger moco-btn-sm" wire:click="edit(<?php echo e($model->id);?>)"><?php echo e(__('Edit'));?></button> <button class="btn btn-primary moco-btn-sm" wire:click="save(<?php echo e($model->id);?>)" <?php if(!$edit):?> disabled <?php endif;?> ><?php echo e(__('Save'));?></button> </div> <?php /**PATH /var/www/moco/fassicms/resources/views/provider/provider-action.blade.php ENDPATH**/?> ======================= File: app/Models/ViewClockingExtended.php ======================= <?php namespace App\Models; use Carbon\Carbon; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class ViewClockingExtended extends Model { use HasFactory; public $table = 'view_clocking_extended'; /** * Retourne la date au format correct * * @param $value * @return string|null */ public function getStartDateAttribute($value):?string { return $value!= ''? Carbon::parse($value)->format('d/m/Y') : null; } /** * Retourne la date au format correct * * @param $value * @return string|null */ public function getStopDateAttribute($value):?string { return $value!= ''? Carbon::parse($value)->format('d/m/Y') : null; } /** * Retourne la date au format correct * * @param $value * @return string|null */ public function getStartTimeAttribute($value):?string { return $value!= ''? Carbon::parse($value)->format('H:i') : null; } /** * Retourne la date au format correct * * @param $value * @return string|null */ public function getStopTimeAttribute($value):?string { return $value!= ''? Carbon::parse($value)->format('H:i') : null; } /** * Retourne la date au format correct * * @param $value * @return string|null */ public function getDiffAttribute($value):?string { return $value!= ''? Carbon::parse($value)->format('H:i') : null; } } ======================= File: app/Http/Controllers/ReassortController.php ======================= <?php /* * Copyright (c) 2020. MO Consult * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Company : Fassi Belgium * Developer : MO Consult * Author : <NAME> * Date : 22/11/20 19:49 */ namespace App\Http\Controllers; use App\Http\Requests\ReassortRequest; use App\Moco\Common\MocoAjaxValidation; use App\Models\Part; use App\Models\Partmetadata; use App\Models\Reason; use App\Models\Reassortement; use App\Models\Worksheet; use Carbon\Carbon; use Illuminate\Http\Request; use App\Models\Store; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; /** * Class ReassortController * @package App\Http\Controllers */ class ReassortController extends Controller { use MocoAjaxValidation; protected $reason_filtering; protected $reason_worksheetId; protected $reason_move_from; /** * ReassortController constructor. */ public function __construct() { $this->formRequest = new ReassortRequest(); $this->reason_filtering = config('moco.reason.filtering'); $this->reason_worksheetId = config('moco.reason.worksheetId'); $this->reason_move_from = config('moco.reassort.moveFrom'); } /** * Retourne la liste des piéces en stock et actives * @return \Illuminate\Contracts\View\View */ public function index() { return view('reassort.reassort-list-main'); } /** * Retourne le formulaire de réassortiment d'une pièces * @param $id * @return \Illuminate\Contracts\View\View */ public function edit($id) { $store = Store::find($id); $partmetadata = $store->partmetadata()->first(); $reasons = Reason::where('option','=',$this->reason_filtering['reassort'])->orWhere('option','=',$this->reason_filtering['all'])->orderBy('reason')->get(); return view('reassort.reassort-part-form',[ '_store' => $store, '_reasons' => $reasons, '_partmetadata' => $partmetadata, '_move_from' => config('moco.reassort.moveFrom'), ]); } /** * Enregistrment d'un réassortiment * * @param Request $request */ public function update(Request $request) { $this->formRequest->setRequestArray($request->all()); //Validation des données $validatedData = $this->validate($request,$this->formRequest->rules(),$this->formRequest->messages(),$this->formRequest->attributes()); //Récupérer l'objet Store $store = Store::find($request->post('id')); //Récupérer L'objet $reason = Reason::find($validatedData['reason']); /** * si la raison est un mouvement de stock * depuis une autre location */ $store_src = null; $out = null; if ($validatedData['reason'] == $this->reason_move_from){ /** * on retrouve le stock source depuis le stock de destination */ $store_src = $store->partmetadata()->first()->getStoreByLocation($request->location_id); /** * création de l'objet Out et mise à jour de la valeur du stock */ $out = $store_src->getOutHydrated($validatedData['qty_add'],$reason, $reason->reason); } /** * si la raison est un retour sur worksheet * il faut créer un objet part */ $part = null; if ($validatedData['reason'] == $this->reason_worksheetId){ /** * Recherche le prix de la pièce dans le catalogue * uniquement pour l'année encours. * Si le retour est null on lève une exception */ $price = $store->getPrice(); if (is_null($price)) { return redirect()->route('reassort')->with('error',trans('No price is available for this part number '). $part); } /** * recherche l'id de la worksheet */ $worksheet = Worksheet::where('number','=',$validatedData['note'])->first(); /** * Hydrate l'objet Part */ $part = new Part(); $part->part_number = $store->partmetadata()->first()->part_number; $part->bar_code = $store->partmetadata()->first()->bar_code; $part->description = $store->partmetadata()->first()->description; $part->qty = $validatedData['qty_add']; $part->price = $price; $part->year = Carbon::now()->year; $part->type = 'R'; $part->location()->associate($store->location()->first()); $part->user()->associate(Auth::user()); $part->worksheet()->associate($worksheet); } /** * création de l'objet Reassort et mise à jour de la quantité */ $reassort = $store->getReassortementHydrated($validatedData['qty_add'],$reason,$request->note); /** * Sauvegarde des objets */ DB::transaction(function () use ($store, $store_src, $part, $reassort, $out) { /** * Si un objet part à été créé */ if (!is_null($part)) $part->save(); /** * Si un objet store_src & out ont été créés */ if((!is_null($store_src)) &&!is_null($out)){ $store_src->save(); $out->save(); } $reassort->save(); $store->save(); }); return redirect()->route('reassort.index')->with('success', 'The new value of the stock has been saved'); } /** * Retourne la valeur du stock pour l'emplacement source * si ce dernier est null ou inférieur à 1 une erreur est retournée * * @param Request $request * @return \Illuminate\Http\JsonResponse */ public function ajaxReassortCheck(Request $request) { $result = [ 'checked' => false, 'src_stock' => 0, 'msg' => null, ]; /** * Objet de destination */ $store = Store::find($request->id); /** * Object source */ $store_src = $store->partmetadata()->first()->getStoreByLocation($request->location_id); /** * Si l'objet source n'est pas null and la qty est supérieur ou egal à 1 */ if (!is_null($store_src) && $store_src->qty >= 1){ $result['checked'] = true; $result['src_stock'] = $store_src->qty; } else { $result['msg'] = trans('There is no stock available at this location'); } return response()->json($result); } } ======================= File: app/Moco/Printer/MocoCustomPageFormat.php ======================= <reponame>smoers/fassicms<filename>app/Moco/Printer/MocoCustomPageFormat.php <?php /* * Copyright (c) 2020. MO Consult * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Company : Fassi Belgium * Developer : MO Consult * Author : <NAME> * Date : 16/12/20 13:02 */ /** * Company : Fassi Belgium * Developer : MO Consult * Authority : <NAME> * Date : 16-12-20 */ namespace App\Moco\Printer; trait MocoCustomPageFormat { private $page_format = array( 'MediaBox' => array ('llx' => 0, 'lly' => 0, 'urx' => 210, 'ury' => 297), 'CropBox' => array ('llx' => 0, 'lly' => 0, 'urx' => 210, 'ury' => 297), 'BleedBox' => array ('llx' => 0, 'lly' => 0, 'urx' => 205, 'ury' => 292), 'TrimBox' => array ('llx' => 0, 'lly' => 0, 'urx' => 200, 'ury' => 287), 'ArtBox' => array ('llx' => 0, 'lly' => 0, 'urx' => 195, 'ury' => 282), 'Dur' => 3, 'trans' => array( 'D' => 1.5, 'S' => 'Split', 'Dm' => 'V', 'M' => 'O' ), 'Rotate' => 0, 'PZ' => 1, ); /** * @param MocoStickerModel $stickerModel */ public function setCustomPageFormat(MocoStickerModel $stickerModel): void { $this->page_format['MediaBox']['urx'] = $stickerModel->w; $this->page_format['MediaBox']['ury'] = $stickerModel->h; $this->page_format['CropBox']['urx'] = $stickerModel->w; $this->page_format['CropBox']['ury'] = $stickerModel->h; $this->page_format['BleedBox']['urx'] = $stickerModel->w; $this->page_format['BleedBox']['ury'] = $stickerModel->h; $this->page_format['TrimBox']['urx'] = $stickerModel->w; $this->page_format['TrimBox']['ury'] = $stickerModel->h; $this->page_format['ArtBox']['urx'] = $stickerModel->w; $this->page_format['ArtBox']['ury'] = $stickerModel->h; } /** * @return array */ public function getCustomPageFormat(): array { return $this->page_format; } } ======================= File: app/Http/Livewire/Reassort/ReassortListParts.php ======================= <reponame>smoers/fassicms<gh_stars>0 <?php /* * Copyright (c) 2020. MO Consult * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Company : Fassi Belgium * Developer : MO Consult * Author : <NAME> * Date : 22/11/20 12:58 */ namespace App\Http\Livewire\Reassort; use App\Models\Partmetadata; use App\Models\Store; use Illuminate\Database\Eloquent\Builder; use Rappasoft\LaravelLivewireTables\TableComponent; use Rappasoft\LaravelLivewireTables\Traits\HtmlComponents; use Rappasoft\LaravelLivewireTables\Views\Column; class ReassortListParts extends TableComponent { use HtmlComponents; public $locationId = null; protected $listeners = ['headerChange']; /** * ReassortListParts constructor. * @param null $id */ public function __construct($id = null) { $this->perPage = config('moco.table.perPage'); $this->perPageOptions = config('moco.table.perPageOptions'); $this->rowClass = config('moco.table.rowClass'); $this->loadingIndicator =true; $this->sortField = 'part_number'; $this->sortDefaultIcon = '<i class="fas fa-sort-alpha-down"></i>'; $this->ascSortIcon = '<i class="fas fa-sort-alpha-up"></i>'; $this->descSortIcon = '<i class="fas fa-sort-alpha-down"></i>'; parent::__construct($id); } /** * Charger lors de la création de l'objet * */ public function mount() { $this->locationId = config('moco.reassort.defaultLocation'); } /** * @return Builder */ public function query(): Builder { return Partmetadata::with('stores') ->select('partmetadatas.*','stores.id as store_id','stores.qty as qty','locations.id as loc_id','locations.location as location') ->leftJoin('stores','partmetadatas.id','=','stores.partmetadata_id') ->leftJoin('locations','locations.id','=','stores.location_id') ->where('partmetadatas.enabled','=',true) ->where('locations.id','=', $this->locationId); } /** * @return array */ public function columns(): array { return [ Column::make(trans('Part Number'), 'part_number') ->searchable() ->sortable(), Column::make(trans('Description'),'description') ->searchable() ->sortable(), Column::make(trans('Quantity'), 'qty') ->format(function (Partmetadata $model){ return $this->html('<div class="text-right w-100 ">'.$model->qty.'</div>'); }), Column::make(trans('Location'), 'location'), Column::make(trans('Actions')) ->format(function (Partmetadata $model){ return view('menus.store-list-sub',['partmetadata' => $model]); }), ]; } /** * @param $attribute * @return string|null */ public function setTableHeadClass($attribute):?string { $extend =''; switch ($attribute) { case 'actions': $extend.= 'moco-size-column-table-400'; break; case 'part_number': $extend.='moco-size-column-table-150'; break; case 'qty': $extend.='moco-size-column-table-100'; break; } return'moco-title-table'.$extend; } /** * @param $attribute * @param $value * @return string|null */ public function setTableDataClass($attribute, $value):?string { return $this->rowClass; } /** * Event déclenché par un changement dans l'entête * * @param $locationId */ public function headerChange($locationId) { $this->locationId = $locationId; } } ======================= File: app/Models/Worksheet.php ======================= <?php /* * Copyright (c) 2020. MO Consult * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Company : Fassi Belgium * Developer : MO Consult * Authority : <NAME> * Date : 08-11-20 */ namespace App\Models; use App\Moco\Common\MocoModelCreatedUpdatedAt; use App\Moco\Common\MocoModelForConsultInterface; use Carbon\Carbon; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Worksheet extends Model implements MocoModelForConsultInterface { use HasFactory, MocoModelCreatedUpdatedAt; protected $fillable = [ 'number', 'date', 'remarks', 'work', 'oil_replace', 'oil_filtered', 'warranty', ]; /** * Liste des relations utilisée pour le formulaire de consultation * * @var string[] */ protected $withForConsult = ['customer','crane','parts','clockings','user']; /** * Retourne l'objet Customer lié à l'objet Worksheet * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function customer(){ return $this->belongsTo(Customer::class); } /** * Retourne l'objet Crane lié à l'objet Worksheet * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function crane(){ return $this->belongsTo(Crane::class); } /** * Retourne les objets Part lié à l'objet Worksheet * * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function parts() { return $this->hasMany(Part::class); } /** * Retourne les objets Clocking lié à l'objet Worksheet * * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function clockings() { return $this->hasMany(Clocking::class); } /** * Retourne l'objet User lié à l'objet Worksheet * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function user() { return $this->belongsTo(User::class); } /** * place la valeur au bon type * * @param $value */ public function setOilReplaceAttribute($value) { $this->attributes['oil_replace'] = floatval(str_replace(',','.',$value)); } /** * retroune la valeur au bon format * * @param $value * @return string|null */ public function getOilReplaceAttribute($value) { if($value == ''){ return '0'; } else { return number_format(floatval(str_replace(',', '.', $value)), 2, ',', ''); } } /** * Place la date avec le format correct dans l'attribut * * @param $value */ public function setDateAttribute($value) { $this->attributes['date'] = Carbon::parse(str_replace('/','-',$value)); } /** * Retourne la date au format correct * * @param $value * @return string|null */ public function getDateAttribute($value) { $return = null; if ($value!= ''){ $return = Carbon::parse($value)->format('d/m/Y'); } return $return; } public function WithForConsult() { return $this->withForConsult; } } ======================= File: storage/framework/views/cdcd951931f10b8426d893ff0c66c224064fab24.php ======================= <reponame>smoers/fassicms<gh_stars>0 <?php if($paginationEnabled || $searchEnabled):?> <div class="row mb-4"> <?php if($paginationEnabled && count($perPageOptions)):?> <div class="col form-inline"> <?php echo app('translator')->get('laravel-livewire-tables::strings.per_page');?>: &nbsp; <select wire:model="perPage" class="form-control"> <?php $__currentLoopData = $perPageOptions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $option): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop();?> <option><?php echo e($option);?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop();?> </select> </div><!--col--> <?php endif;?> <?php if($searchEnabled):?> <div class="col"> <?php if($clearSearchButton):?> <div class="input-group"> <?php endif;?> <input <?php if(is_numeric($searchDebounce) && $searchUpdateMethod === 'debounce'):?> wire:model.debounce.<?php echo e($searchDebounce);?>ms="search" <?php endif;?> <?php if($searchUpdateMethod === 'lazy'):?> wire:model.lazy="search" <?php endif;?> <?php if($disableSearchOnLoading):?> wire:loading.attr="disabled" <?php endif;?> class="form-control" type="text" placeholder="<?php echo e(__('laravel-livewire-tables::strings.search'));?>" /> <?php if($clearSearchButton):?> <div class="input-group-append"> <button class="btn btn-outline-dark" type="button" wire:click="clearSearch"><?php echo app('translator')->get('laravel-livewire-tables::strings.clear');?></button> </div> </div> <?php endif;?> </div> <?php endif;?> <?php echo $__env->make('laravel-livewire-tables::'.config('laravel-livewire-tables.theme').'.includes.export', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render();?> </div><!--row--> <?php endif;?> <?php /**PATH /var/www/Moco/fassicms/vendor/rappasoft/laravel-livewire-tables/src/../resources/views/bootstrap-4/includes/options.blade.php ENDPATH**/?> ======================= File: storage/framework/views/70541efa41ef9e0c022ee49a6deb6b94dc6f98e1.php ======================= <filename>storage/framework/views/70541efa41ef9e0c022ee49a6deb6b94dc6f98e1.php <?php if($offlineIndicator):?> <div wire:offline.class="d-block" wire:offline.class.remove="d-none" class="alert alert-danger d-none"> <?php echo app('translator')->get('laravel-livewire-tables::strings.offline');?> </div> <?php endif;?> <?php /**PATH /var/www/Moco/fassicms/vendor/rappasoft/laravel-livewire-tables/src/../resources/views/bootstrap-4/includes/offline.blade.php ENDPATH**/?> ======================= File: storage/framework/views/35fd15b7ef4cbc79fecc26ea68c1ab5ceb47f780.php ======================= <reponame>smoers/fassicms <?php $__env->startSection('content');?> <div class="container p-5 h-100 moco-layout-height"> <div class="card"> <div class="card-header text-center font-weight-bold"> </div> <div class="card-body"> <p> <a class="btn btn-primary" data-toggle="collapse" href="#t123456789" role="button" aria-expanded="false" aria-controls="t123456789"> Link with href </a> <button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#1444bhguthrtg784545" aria-expanded="false" aria-controls="1444bhguthrtg784545"> Button with data-target </button> </p> <div class="collapse" id="t123456789"> <div class="card card-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. </div> </div> </div> </div> </div> <?php $__env->stopSection();?> <?php echo $__env->make('layouts.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render();?><?php /**PATH /var/www/moco/fassicms/resources/views/consult/test.blade.php ENDPATH**/?> ======================= File: storage/framework/views/be3c7a939ae44357dbc5de038e719170902fe354.php ======================= <reponame>smoers/fassicms <?php if($paginationEnabled):?> <div class="row"> <div class="col"> <?php echo e($models->links());?> </div> <div class="col text-right text-muted"> <?php echo app('translator')->get('laravel-livewire-tables::strings.results', [ 'first' => $models->count()? $models->firstItem() : 0, 'last' => $models->count()? $models->lastItem() : 0, 'total' => $models->total() ]);?> </div> </div> <?php endif;?> <?php /**PATH /var/www/Moco/fassicms/vendor/rappasoft/laravel-livewire-tables/src/../resources/views/bootstrap-4/includes/pagination.blade.php ENDPATH**/?> ======================= File: storage/framework/views/2ca0d8f9baf46333a99f9d2bf3c965ac5ebdbbe7.php ======================= <div class="d-flex flex-row justify-content-start mb-3 ml-3" style="vertical-align: center"> <div class="moco-color-info mr-2"><i class="fas fa-map-pin fa-2x"></i></div> <div> <select wire:model='locationId' id="location" class="form-control moco-row-table-font-small" data-width="fit" title="<?php echo e(__('Select a Location'));?>"> <?php $__currentLoopData = App\Models\Location::all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $location): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop();?> <option value="<?php echo e($location->id);?>" class="moco-row-table-font-small" ><?php echo e(__($location->location)." : ".__($location->description));?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop();?> </select> </div> </div> <?php /**PATH /var/www/moco/fassicms/resources/views/livewire/reassort/reassort-list-head.blade.php ENDPATH**/?> ======================= File: app/Models/CustomerContact.php ======================= <reponame>smoers/fassicms<gh_stars>0 <?php namespace App\Models; use App\Moco\Common\MocoModelCreatedUpdatedAt; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Support\Facades\Auth; class CustomerContact extends Model { use HasFactory, MocoModelCreatedUpdatedAt; protected $fillable=[ 'firstname', 'lastname', 'function', 'phone', 'mobile', ]; /** * Retourne l'objet User lié à l'objet CustomerContact * @return BelongsTo */ public function user() { return $this->belongsTo(User::class); } /** * Retourne l'objet Customer lié à l'objet CustomerContact * * @return BelongsTo */ public function customer() { return $this->belongsTo(Customer::class); } /** * Hydrate des objets CustomerContact au départ d'une collection * Doit-être exécuté avec un objet Customer disposant d'un ID * * @param array $contacts * @param Customer $customer * @return void */ public static function hydratedAndSave(array $contacts, Customer $customer): void { for ($index = 0; $index < count($contacts['lastname']); $index++){ if (!is_null($contacts['id'][$index])){ $contact = CustomerContact::find($contacts['id'][$index]); } else { $contact = new CustomerContact(); } $contact->firstname = $contacts['firstname'][$index]; $contact->lastname = $contacts['lastname'][$index]; $contact->function = $contacts['function'][$index]; $contact->phone = $contacts['phone'][$index]; $contact->mobile = $contacts['mobile'][$index]; $contact->user()->associate(Auth::user()); $contact->customer()->associate($customer); $contact->save(); } } /** * Supprime les contacts * * @param array $contacts * @param Customer $customer */ public static function remove(array $contacts, Customer $customer): void { $currentContacts = CustomerContact::where('customer_id','=',$customer->id)->get(); foreach ($currentContacts as $currentContact){ if (!in_array($currentContact->id, $contacts['id'])) $currentContact->delete(); } } } ======================= File: app/Models/Crane.php ======================= <reponame>smoers/fassicms<filename>app/Models/Crane.php <?php /* * Copyright (c) 2020. MO Consult * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Company : Fassi Belgium * Developer : MO Consult * Authority : <NAME> * Date : 08-11-20 */ namespace App\Models; use App\Moco\Common\MocoModelCreatedUpdatedAt; use App\Moco\Common\MocoModelForConsultInterface; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Crane extends Model implements MocoModelForConsultInterface { use HasFactory, MocoModelCreatedUpdatedAt; protected $fillable =[ 'serial', 'model', 'plate', ]; /** * Liste des relations utilisée pour le formulaire de consultation * * @var string[] */ protected $withForConsult = ['worksheets','user']; /** * Retourne les objets Worksheet pour cet objet Crane * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function worksheets(){ return $this->hasMany(Worksheet::class); } /** * Retourne l'objet User lié à l'objet Worksheet * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function user() { return $this->belongsTo(User::class); } /** * détermine si la grue existe * @param string $serial * @param string $plate * @return bool */ public static function exist(string $serial, string $plate){ return self::where('serial','=',$serial)->where('plate','=',$plate)->get()->count() == 1; } /** * @return string[] */ public function WithForConsult() { return $this->withForConsult; } } ======================= File: storage/framework/views/5b88c7c4d84639ceeeb6cbc0f0390d4de1297009.php ======================= <?php $__env->startSection('content');?> <div class="container p-5 h-100 moco-layout-height"> <div class="card"> <div class="card-header text-center font-weight-bold"> <h2 class="blue-grey-darker-hover"><?php echo e(__('Stock restocking'));?></h2> </div> <div class="card-body"> <form name="part-form" id="part-form" method="post" action="<?php echo e(route('reassort.update'));?>" moco-validation> <?php echo csrf_field();?> <input type="hidden" id="id" name="id" value="<?php echo e($_store->id);?>"> <!-- Part Number--> <div class="form-group"> <label for="part_number"><?php echo e(__('Part Number'));?></label> <input type="text" id="part_number" name="part_number" class="form-control" readonly value="<?php echo e(old('part_number', $_partmetadata->part_number));?>" moco-validation /> </div> <!-- Sur une ligne--> <div class="row"> <div class="col-8"> <!-- Description --> <div class="form-group"> <label for="description"><?php echo e(__('Description'));?></label> <input type="text" id="description" name="description" class="form-control" readonly value="<?php echo e(old('description', $_partmetadata->description));?>" moco-validation /> </div> </div> <div class="col-4"> <!-- Location --> <div class="form-group"> <label for="description"><?php echo e(__('Location'));?></label> <input type="text" id="location" name="location" class="form-control" readonly value="<?php echo e(old('location', $_store->location()->first()->location.' : '.$_store->location()->first()->description));?>" moco-validation /> </div> </div> </div> <!-- Sur une ligne--> <div class="row"> <!-- qty-before --> <div class="col-4"> <div class="form-group"> <label for="qty_before"><?php echo e(__('Number of pieces in stock'));?></label> <input type="number" id="qty_before" name="qty_before" class="form-control" readonly value="<?php echo e(old('qty_before', $_store->qty));?>" moco-validation /> </div> </div> <!-- qty-add --> <div class="col-4"> <div class="form-group"> <label for="qty_add"><?php echo e(__('Number of parts to add'));?></label> <input type="number" id="qty_add" name="qty_add" class="form-control" value="<?php echo e(old('qty_add'));?>" moco-validation /> <div class="moco-error-small danger-darker-hover" id="qty_addError"></div> </div> </div> <!-- qty-new --> <div class="col-4"> <div class="form-group"> <label for="qty_new"><?php echo e(__('New stock'));?></label> <input type="number" id="qty_new" name="qty_new" class="form-control" readonly value="<?php echo e(old('qty_new'));?>" moco-validation /> </div> </div> </div> <div class="row"> <div class="col-6"> <!-- Reason --> <div class="d-flex flex-column"> <div><?php echo e(__('Reason'));?></div> <div> <select id="reason" name="reason" class="selectpicker form-control" data-live-search="true" title="<?php echo e(__('Select a reason'));?>" moco-validation> <?php $__currentLoopData = $_reasons; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $_reason): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop();?> <option value="<?php echo e($_reason->id);?>" <?php if($_reason->id == old('reason')):?> selected <?php endif;?>><?php echo e(__($_reason->reason));?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop();?> </select> <div class="moco-error-small danger-darker-hover" id="reasonError"></div> </div> </div> </div> <div class="col-6"> <!-- Note --> <div class="form-group note_area"> <label for="note"><?php echo e(__('Note'));?></label> <input type="text" id="note" name="note" class="form-control" value="<?php echo e(old('note'));?>" moco-validation /> <div class="moco-error-small danger-darker-hover" id="noteError"></div> </div> <div class="row"> <div class="col-8"> <!-- Location --> <div class="d-flex flex-column location_area"> <div class="location_area"><?php echo e(__('Location from'));?></div> <div class="location_area"> <select id="location_id" name="location_id" disabled class="selectpicker form-control" data-width="fit" title="<?php echo e(__('Select a Location'));?>" moco-validation> <?php $__currentLoopData = App\Models\Location::all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $location): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop();?> <option value="<?php echo e($location->id);?>" <?php if(old('location_id',$_store->location_id) == $location->id):?> selected <?php endif;?>><?php echo e(__($location->location)." : ".__($location->description));?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop();?> </select> <div class="moco-error-small danger-darker-hover" id="location_idError"></div> </div> </div> </div> <div class="col-4"> <div class="form-group location_area"> <label for="src_stock"><?php echo e(__('Source stock'));?></label> <input type="text" id="src_stock" disabled name="src_stock" class="form-control" readonly moco-validation/> </div> </div> </div> </div> </div> <div class="d-flex justify-content-between"> <div> <button type="submit" class="btn btn-primary"><?php echo e(__('Save'));?></button> </div> <div> <a href="<?php echo e(route('reassort.index'));?>" class="btn btn-primary"><?php echo e(__('Cancel'));?></a> </div> </div> </form> </div> </div> </div> <!-- Modal message--> <div class="modal" id="modal_msg" data-backdrop="static" data-keyboard="false"> <div class="modal-dialog modal-dialog-centered"> <div class="modal-content"> <div class="modal-header"> <div class="container-fluid"> <div class="d-flex justify-content-sm-center"> <p class="moco-color-info h4"> <?php echo e(__('Error message'));?></p> </div> </div> </div> <div class="modal-body"> <div class="d-flex flex-row justify-content-md-start"> <div class="mr-3"><i class="fa fa-exclamation-triangle fa-3x" style="color: red!important;"></i></div> <div id="_msg" class="moco-color-error"></div> </div> </div> <div class="modal-footer"> <div class="container-fluid"> <div class="d-flex justify-content-md-end"> <button type="button" class="btn btn-danger" data-dismiss="modal"><?php echo e(__('Cancel'));?></button> </div> </div> </div> </div> </div> </div> <script type="text/javascript" src="<?php echo e(asset('js/moco.ajax.validation.js'));?>"></script> <script type="text/javascript"> $(function () { /** Ajax set up **/ $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, type: "POST", dataType: "json", async: true, }); /** url pour les requêtes Ajax **/ var _url_ajax_reassort = '<?php echo e(route('reassort.ajaxreassortcheck'));?>' /** Cache le champ location **/ $('.location_area').hide(); /** on retire de la liste l'emplacement actuel **/ $('#location_id').find('[value=<?php echo e($_store->location()->first()->id);?>]').remove(); /** dans le cas d'un retour vers le formulaire après une validation avec erreur **/ updateInterface(); setLocation(_url_ajax_reassort); /** event sur le changement de raison **/ $('#reason').on('changed.bs.select', function (e, clickedIndex, isSelected, previousValue){ updateInterface(); }); /** event sur le choix de l'emplacement d'origine **/ $('#location_id').on('changed.bs.select', function (){ setLocation(_url_ajax_reassort); }); /** calcule la nouvelle valeur du stock **/ $('#qty_add').on('keyup', function (event) { add = $('#qty_add').val(); before = $('#qty_before').val(); if(!isNaN(add) &&!isNaN(before)) { $('#qty_new').val(parseInt(before) + parseInt(add)); } }); }); /** * quand un emplacement est choisi on en recherche la qty en stock */ function setLocation(url){ let data = { location_id: parseInt($('#location_id').val()), id: parseInt($('#id').val()) } /** requète ajax **/ request(data,url).then((result) => { if (result.checked == true){ $('#src_stock').val(result.src_stock); } else { /** * affiche le message modal */ $('#_msg').html(result.msg); $('#modal_msg').modal('show'); } }); } /** * affiche les champs en relation avec le choix de la raison */ function updateInterface(){ if($('#reason').val() == <?php echo e($_move_from);?>){ /** affiche le combo avec les emplacements **/ $('.note_area').hide(); $('.location_area').show(); $('#location_id').prop('disabled', false); $('#location_id').selectpicker('refresh'); $('#src_stock').removeAttr('disabled'); } else { $('.note_area').show(); $('.location_area').hide(); $('#location_id').prop('disabled', true); $('#location_id').selectpicker('refresh'); $('#src_stock').attr('disabled','disabled'); }; } /** remet la valeur du combo location sur null **/ $('#modal_msg').on('hidden.bs.modal',() => { $('#location_id').val('default').selectpicker('refresh'); $('#src_stock').val(''); }); </script> <?php $__env->stopSection();?> <?php echo $__env->make('layouts.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render();?><?php /**PATH /var/www/moco/fassicms/resources/views/reassort/reassort-part-form.blade.php ENDPATH**/?> ======================= File: storage/framework/views/df24578d2dbe3f28227f58398996865c3124bd35.php ======================= <filename>storage/framework/views/df24578d2dbe3f28227f58398996865c3124bd35.php <?php $__env->startSection('content');?> <div class="container p-5 h-100 moco-layout-height"> <div class="card mb-3"> <div class="card-header text-center font-weight-bold"> <h2 class="blue-grey-darker-hover"><?php echo e(__('Providers List'));?></h2> </div> <div class="card-body" style="font-size: 12px"> <?php if (! isset($_instance)) { $html = \Livewire\Livewire::mount('provider.provider-list', [])->html(); } elseif ($_instance->childHasBeenRendered('zYU9JBb')) { $componentId = $_instance->getRenderedChildComponentId('zYU9JBb'); $componentTag = $_instance->getRenderedChildComponentTagName('zYU9JBb'); $html = \Livewire\Livewire::dummyMount($componentId, $componentTag); $_instance->preserveRenderedChild('zYU9JBb'); } else { $response = \Livewire\Livewire::mount('provider.provider-list', []); $html = $response->html(); $_instance->logRenderedChild('zYU9JBb', $response->id(), \Livewire\Livewire::getRootElementTagName($html)); } echo $html; ?> </div> </div> </div> <?php $__env->stopSection();?> <?php echo $__env->make('layouts.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render();?><?php /**PATH /var/www/moco/fassicms/resources/views/provider/provider-list.blade.php ENDPATH**/?> ======================= File: resources/views/root/dashboard.blade.php ======================= <reponame>smoers/fassicms<filename>resources/views/root/dashboard.blade.php @extends('layouts.layout') @section('content') <div class="container p-5 h-100 moco-layout-height"> <div class="d-flex flex-wrap"> @asyncWidget('VersionInfo') @if($asReassort && auth()->user()->can('show reassort list')) @asyncWidget('StockInfo') @endif </div> </div> @endsection ======================= File: app/Rules/CraneUnique.php ======================= <reponame>smoers/fassicms <?php namespace App\Rules; use Illuminate\Contracts\Validation\Rule; use App\Models\Crane; class CraneUnique implements Rule { private $data; /** * Create a new rule instance. * * @return void */ public function __construct(array $data) { $this->data = $data; } /** * Determine if the validation rule passes. * * @param string $attribute * @param mixed $value * @return bool */ public function passes($attribute, $value) { /** * Par défaut */ $return = true; /** * Si les deux key existe */ if (array_key_exists('serial', $this->data) && array_key_exists('plate', $this->data)) { /** * Si on contrôle le serial */ if ($attribute =='serial') { $serial = $value; $plate = $this->data['plate']; /** * Si on contrôle le plate */ } elseif ($attribute == 'plate') { $serial = $this->data['serial']; $plate = $value; } /** * Check l'existence */ if ($serial!= '' && $plate!= '') { $crane = new Crane(); /** * Dans le cas d'un update on récupère l'objet */ if (array_key_exists('id', $this->data) && $this->data['id']!= null) { $crane = Crane::find($this->data['id']); } $return =!Crane::exist($serial, $plate) || ($crane->serial == $serial && $crane->plate == $plate && Crane::exist($serial, $plate)); } } return $return; } /** * Get the validation error message. * * @return string */ public function message() { return trans('The combination between the serial and the plate already exist'); } } ======================= File: app/Moco/Printer/MocoFileName.php ======================= <?php /* * Copyright (c) 2021. MO Consult * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Company : Fassi Belgium * Developer : MO Consult * Author : <NAME> * Date : 17/02/21 18:26 */ /** * Company : Fassi Belgium * Developer : MO Consult * Authority : <NAME> * Date : 17-02-21 */ namespace App\Moco\Printer; use Carbon\Carbon; use Illuminate\Support\Facades\Auth; trait MocoFileName { public function getFormattedFileName(array $suffix) { $name = 'PDF_'.Auth::id(); foreach ($suffix as $value) $name = $name.'_'.$value; return $name.'_'.Carbon::now()->format('YmdHis').'.pdf'; } } ======================= File: storage/framework/views/53fd60962b50afb3459b3cd9201f6ea36bc3470a.php ======================= <filename>storage/framework/views/53fd60962b50afb3459b3cd9201f6ea36bc3470a.php <!-- message --> <?php if($message = Session::get('success')):?> <script type="text/javascript"> iziToast.success({ title: '<?php echo e(__('Success'));?>', message: '<?php echo e(__($message));?>', timeout: 10000, }); </script> <?php endif;?> <?php if($message = Session::get('error')):?> <script type="text/javascript"> iziToast.error({ title: '<?php echo e(__('Error'));?>', message: '<?php echo e(__($message));?>', timeout: 10000, }); </script> <?php endif;?> <?php if($message = Session::get('warning')):?> <script type="text/javascript"> iziToast.warning({ title: '<?php echo e(__('Warning'));?>', message: '<?php echo e(__($message));?>', timeout: 10000, }); </script> <?php endif;?> <?php if($message = Session::get('info')):?> <script type="text/javascript"> iziToast.info({ title: '<?php echo e(__('Info'));?>', message: '<?php echo e(__($message));?>', timeout: 10000, }); </script> <?php endif;?> <?php if($errors->any()):?> <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop();?> <script type="text/javascript"> iziToast.error({ title: '<?php echo e(__('Error'));?>', message: '<?php echo e(__($error));?>', timeout: 10000, }); </script> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop();?> <?php endif;?> <?php /**PATH /var/www/moco/fassicms/resources/views/root/message.blade.php ENDPATH**/?> ======================= File: resources/lang/vendor/laravel-livewire-tables/fr/strings.php ======================= <gh_stars>0 <?php return [ 'clear' => 'Effacer', 'export' => 'Exporter', 'loading' => 'Chargement...', 'no_results' => 'Il n\'y a aucun résultat à afficher pour cette requête.', 'offline' => 'Vous n\'êtes actuellement pas connecté à Internet.', 'per_page' => 'Par Page', 'results' => 'Affichage :first à :last sur :total résultats', 'search' => 'Chercher...', ]; ======================= File: database/factories/TechnicianFactory.php ======================= <?php namespace Database\Factories; use App\Models\Technician; use Illuminate\Database\Eloquent\Factories\Factory; use Carbon\Carbon; class TechnicianFactory extends Factory { /** * The name of the factory's corresponding model. * * @var string */ protected $model = Technician::class; /** * Define the model's default state. * * @return array */ public function definition() { return [ 'number' => intval(Carbon::now('Europe/Brussels')->format('yymdHis')), 'lastname' => $this->faker->lastName, 'firstname' => $this->faker->firstName, 'enabled' => true, 'user_id' => 1 ]; } } ======================= File: app/Exports/WorksheetExport.php ======================= <reponame>smoers/fassicms <?php /* * Copyright (c) 2021. MO Consult * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Company : Fassi Belgium * Developer : MO Consult * Author : <NAME> * Date : 19/10/21 16:49 */ /** * Company : Fassi Belgium * Developer : MO Consult * Authority : <NAME> * Date : 19-10-21 */ namespace App\Exports; use App\Models\Worksheet; use Carbon\Carbon; use Illuminate\Database\Query\Builder; use Maatwebsite\Excel\Concerns\Exportable; use Maatwebsite\Excel\Concerns\FromQuery; use Maatwebsite\Excel\Concerns\ShouldAutoSize; use Maatwebsite\Excel\Concerns\WithColumnFormatting; use Maatwebsite\Excel\Concerns\WithCustomValueBinder; use Maatwebsite\Excel\Concerns\WithHeadings; use App\Moco\Common\Moco; use Maatwebsite\Excel\Concerns\WithStrictNullComparison; use Maatwebsite\Excel\Concerns\WithStyles; use Maatwebsite\Excel\Concerns\WithTitle; use Maatwebsite\Excel\DefaultValueBinder; use PhpOffice\PhpSpreadsheet\Cell\Cell; use PhpOffice\PhpSpreadsheet\Cell\DataType; use PhpOffice\PhpSpreadsheet\Style\NumberFormat; class WorksheetExport extends DefaultValueBinder implements FromQuery, WithHeadings, WithColumnFormatting, ShouldAutoSize, WithStyles, WithCustomValueBinder, WithStrictNullComparison, WithTitle { use Exportable; private $id; /** * Constructeur * * @param $id */ public function __construct($id) { $this->id = $id; } /** * Réquête vers la DB * * @return \Illuminate\Database\Eloquent\Builder|Builder */ public function query() { return Worksheet::query()->whereKey($this->id); } /** * Titre des colonnes * * @return array */ public function headings(): array { return Moco::translateArrayValue(config('moco.consult.fields.worksheets.name')); } /** * Format des colonnes * * @return array */ public function columnFormats(): array { return [ 'B' => NumberFormat::FORMAT_NUMBER, ]; } /** * STyle de la ligne de titre * * @param \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $sheet * @return \bool[][][] */ public function styles(\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $sheet) { return [ 1 => ['font' => ['bold' => true, 'italic' => true]], ]; } /** * @param Cell $cell * @param mixed $value * @return bool * @throws \PhpOffice\PhpSpreadsheet\Exception */ public function bindValue(Cell $cell, $value): bool { if ($cell->getWorksheet()->getTitle() === trans('Worksheet')){ if ($cell->getColumn() == 'F' || $cell->getColumn() == 'G' || $cell->getColumn() == 'O') { if (is_numeric($value) && $value == 1) { $cell->setValueExplicit(true, DataType::TYPE_BOOL); return true; } elseif (is_numeric($value) && ($value == 0)) { $cell->setValueExplicit(False, DataType::TYPE_BOOL); return true; } } elseif ($cell->getColumn() == 'N' && $cell->getRow() > 1){ $cell->setValueExplicit(Moco::floatValReplace($value),DataType::TYPE_NUMERIC); return true; } } return parent::bindValue($cell, $value); // TODO: Change the autogenerated stub } /** * Défini le titre de la sheet * * @return string */ public function title(): string { return trans('Worksheet'); } } ======================= File: resources/views/worksheet/clocking-technician-form.blade.php ======================= @extends('layouts.layout') @section('content') <div class="container p-5 h-100 moco-layout-height" style="min-width: 50vw"> <div class="card"> <div class="card-header text-center font-weight-bold"> <h2 class="blue-grey-darker-hover">{{__('Technician clocking')}}</h2> </div> <div class="card-body"> <div class="d-flex justify-content-between p-2"> <div id="timedate" class="mr-2 mt-1"> <a id="mon">January</a> <a id="d">1</a>, <a id="y">0</a><br /> <a id="h">12</a> : <a id="m">00</a>: <a id="s">00</a> </div> <div class="d-flex flex-column justify-content-around"> <div class="d-flex flex-row justify-content-end"> <input type="hidden" id="worksheet_id" name="worksheet_id" value=""/> <div class="mr-2 mt-1 moco-color-error moco-row-table-font-large">{{__('Worksheet Number')}} :</div> <input id="number" name="number" class="form-control form-control" style="width: auto" autocomplete="off" value=""/> </div> <div class="d-flex flex-row justify-content-end"> <div id="technician_field" class="mr-2 mt-1 moco-color-error moco-row-table-font-large">{{__('Technician number')}} :</div> <input id="technician" name="technician" class="form-control form-control" style="width: auto" autocomplete="off" value=""/> </div> </div> </div> <div class="container-fluid"> <div class="m-3 moco-color-success font-italic moco-row-table-font-large" id="success_msg"> </div> </div> </div> </div> </div> <!-- Modal message--> <div class="modal" id="modal_msg" data-backdrop="static" data-keyboard="false"> <div class="modal-dialog modal-dialog-centered"> <div class="modal-content"> <div class="modal-header"> <div class="container-fluid"> <div class="d-flex justify-content-sm-center"> <p class="moco-color-info h4"> {{__('Error message')}}</p> </div> </div> </div> <div class="modal-body"> <div class="d-flex flex-row justify-content-md-start"> <div class="mr-3"><i class="fa fa-exclamation-triangle fa-3x" style="color: red!important;"></i></div> <div id="_msg" class="moco-color-error"></div> </div> </div> <div class="modal-footer"> <div class="container-fluid"> <div class="d-flex justify-content-md-end"> <button type="button" class="btn btn-danger" data-dismiss="modal">{{__('Cancel')}}</button> </div> </div> </div> </div> </div> </div> <!-- Script --> <script type="text/javascript" src="{{ asset('js/moco.clock.js') }}"></script> <script type="text/javascript"> $(function (){ /* * fonction pour l'horloge */ initClock('{{Auth::user()->language}}'); $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, type: "POST", dataType: "json", async: true, }); var _url_worksheetcheck = '{{route('clocking.ajaxworksheetcheck')}}' var _url_teccheck = '{{route('clocking.ajaxtechniciancheck')}}' /* * init les champs */ initField(); /* * event sur le champ numéro fiche de travail */ $('#number').on('change', function() { /** * on check la fiche de travail * si elle existe et si elle peut être modifée */ let _number = $(this).val(); /** * Requête ajax rendue sync */ request({number: _number}, _url_worksheetcheck).then((result) => { if (result.checked == true){ /* mémorie l'id de la fiche de travail*/ $('#worksheet_id').val(result.id); /* Le numéro est valide, on place en lecture seul le champ number */ $('#number').attr('readonly','readonly'); /* activation du champ pour le numéro technicien */ $('#technician').removeAttr('hidden'); $('#technician_field').removeAttr('hidden'); /* donne le focus au champ technician*/ $('#technician').focus(); } }); }); $('#technician').on('change', function(){ /** * on va checker si le technicien existe * et s'il peut mettre des heures sur la fiche de travail */ let _tec_number = $(this).val(); /* donnée pour la requête Ajax*/ let _data = { worksheet_id: parseInt($('#worksheet_id').val()), tec_number: _tec_number, }; /* requête */ request(_data,_url_teccheck).then((result) => { /* réinitalise les champs*/ initField() if(result.checked){ /* affiche le message */ console.log(result.msg); $('#success_msg').append(result.msg); /* prévoit la suppression du message */ const stop = window.setInterval(() => { $('#success_msg').empty(); clearInterval(stop); },15000); } else { /** * affiche le message modal */ $('#_msg').html(result.msg); $('#modal_msg').modal('show'); } }); }); }); /** * Initialise les champs */ function initField(){ /* * supprime le contenu */ $('#number').val(''); $('#technician').val(''); /* * unlock */ $('#number').removeAttr('readonly'); /* * donne le focus au numéro de la fiche de travail */ $('#number').focus(); /* * cache le champ technicien */ $('#technician').attr('hidden','hidden'); $('#technician_field').attr('hidden','hidden'); } /** * Permet de redonner le focus au champ numéro de fiche de travail après la fermeture de modal */ $('#modal_msg').on('hidden.bs.modal',() => $('#number').focus()); </script> @endsection ======================= File: resources/views/worksheet/part-consult.blade.php ======================= @extends('layouts.layout') @section('content') <div class="container p-5 h-100 moco-layout-height" style="min-width: 50vw"> <div class="card"> <div class="card-header text-center font-weight-bold"> <h2 class="blue-grey-darker-hover">{{__('Parts list')}}</h2> </div> <div class="card-body"> <div class="d-flex justify-content-between mb-3"> <div class="d-flex flex-row"> <div class="mr-2">{{_('Date')}} :</div> <div class="mr-2">{{$worksheet->date}}</div> </div> <div class="d-flex flex-row"> <div class="mr-2">{{_('Number')}} :</div> <div class="mr-2 moco-color-error">{{$worksheet->number}}</div> </div> <div class="d-flex flex-row"> <div class="mr-2">{{_('Total')}} :</div> <div class="mr-2 moco-color-error" style="font-weight: bold">{{number_format(intval($_total['O'])+intval($_total['R']),2,',','.')}}</div> </div> </div> <ul class="nav nav-tabs nav-fill mb-3" > <li class="nav-item" > <a href="#out" class="nav-link active" data-toggle="tab">{{__('Parts Out')}}</a> </li> <li class="nav-item"> <a href="#in" class="nav-link" data-toggle="tab">{{__('Parts Return')}}</a> </li> </ul> <div class="tab-content"> <!-- TAB OUT--> <div class="tab-pane fade show active" id="out"> <table class="table table-sm table-striped table-bordered mt-2"> <thead class="moco-title-table"> <tr> <th class="moco-row-table-font-small">{{ __('Part Number') }}</th> <th class="moco-row-table-font-small">{{ __('Description') }}</th> <th class="moco-row-table-font-small">{{ __('Quantity') }}</th> <th class="moco-row-table-font-small">{{ __('Unit Price') }}</th> <th class="moco-row-table-font-small">{{ __('Total Price') }}</th> <th class="moco-row-table-font-small">{{ __('Year') }}</th> <th class="moco-row-table-font-small">{{ __('Date') }}</th> </tr> </thead> <tbody> @foreach($_outs as $_out) <tr> <td class="moco-row-table-font-small">{{$_out->part_number}}</td> <td class="moco-row-table-font-small">{{$_out->description}}</td> <td class="moco-row-table-font-small text-right">{{$_out->qty_signed}}</td> <td class="moco-row-table-font-small text-right">{{$_out->unit_price_signed}}</td> <td class="moco-row-table-font-small text-right">{{$_out->total_price_signed}}</td> <td class="moco-row-table-font-small text-right">{{$_out->year}}</td> <td class="moco-row-table-font-small text-right">{{$_out->updated_at}}</td> </tr> @endforeach <tr> <td colspan="4" class="moco-row-table-font-small text-right moco-color-error" style="font-weight: bold">Total :</td> <td class="moco-row-table-font-small text-right moco-color-error" style="font-weight: bold">{{number_format(intval($_total['O']),2,',','.')}}</td> <td colspan="2"></td> </tr> </tbody> </table> </div> <div class="tab-pane fade show" id="in"> <table class="table table-sm table-striped table-bordered table-dark mt-2"> <thead class="moco-title-table"> <tr> <th class="moco-row-table-font-small">{{ __('Part Number') }}</th> <th class="moco-row-table-font-small">{{ __('Description') }}</th> <th class="moco-row-table-font-small">{{ __('Quantity') }}</th> <th class="moco-row-table-font-small">{{ __('Unit Price') }}</th> <th class="moco-row-table-font-small">{{ __('Total Price') }}</th> <th class="moco-row-table-font-small">{{ __('Year') }}</th> <th class="moco-row-table-font-small">{{ __('Date') }}</th> </tr> </thead> <tbody> @foreach($_reassorts as $_reassort) <tr> <td class="moco-row-table-font-small">{{$_reassort->part_number}}</td> <td class="moco-row-table-font-small">{{$_reassort->description}}</td> <td class="moco-row-table-font-small text-right">{{$_reassort->qty_signed}}</td> <td class="moco-row-table-font-small text-right">{{$_reassort->unit_price_signed}}</td> <td class="moco-row-table-font-small text-right">{{$_reassort->total_price_signed}}</td> <td class="moco-row-table-font-small text-right">{{$_reassort->year}}</td> <td class="moco-row-table-font-small text-right">{{$_reassort->updated_at}}</td> </tr> @endforeach <tr> <td colspan="4" class="moco-row-table-font-small text-right moco-color-error" style="font-weight: bold">Total :</td> <td class="moco-row-table-font-small text-right moco-color-error" style="font-weight: bold">{{number_format(intval($_total['R']),2,',','.')}}</td> <td></td> </tr> </tbody> </table> </div> </div> </div> </div> </div> @endsection ======================= File: storage/framework/views/05a74b0221700aca99a60335b9994a73879292aa.php ======================= <filename>storage/framework/views/05a74b0221700aca99a60335b9994a73879292aa.php <?php $__env->startSection('content');?> <div class="<?php echo e($options->getContainer());?> p-2 h-100 moco-layout-height"> <?php if($options->getName() == 'form01'):?> <?php if (! isset($_instance)) { $html = \Livewire\Livewire::mount('store.store-part-form', [])->html(); } elseif ($_instance->childHasBeenRendered('igSMXba')) { $componentId = $_instance->getRenderedChildComponentId('igSMXba'); $componentTag = $_instance->getRenderedChildComponentTagName('igSMXba'); $html = \Livewire\Livewire::dummyMount($componentId, $componentTag); $_instance->preserveRenderedChild('igSMXba'); } else { $response = \Livewire\Livewire::mount('store.store-part-form', []); $html = $response->html(); $_instance->logRenderedChild('igSMXba', $response->id(), \Livewire\Livewire::getRootElementTagName($html)); } echo $html; ?> <?php elseif($options->getName() == 'list01'):?> <div class="container-fluid text-center mb-3"> <div class="moco-title brown-lighter-hover"><?php echo e(__('Parts List'));?></div> </div> <?php if (! isset($_instance)) { $html = \Livewire\Livewire::mount('store-list-head', [])->html(); } elseif ($_instance->childHasBeenRendered('631dJrs')) { $componentId = $_instance->getRenderedChildComponentId('631dJrs'); $componentTag = $_instance->getRenderedChildComponentTagName('631dJrs'); $html = \Livewire\Livewire::dummyMount($componentId, $componentTag); $_instance->preserveRenderedChild('631dJrs'); } else { $response = \Livewire\Livewire::mount('store-list-head', []); $html = $response->html(); $_instance->logRenderedChild('631dJrs', $response->id(), \Livewire\Livewire::getRootElementTagName($html)); } echo $html; ?> <?php if (! isset($_instance)) { $html = \Livewire\Livewire::mount('store-list', [])->html(); } elseif ($_instance->childHasBeenRendered('paI9nB1')) { $componentId = $_instance->getRenderedChildComponentId('paI9nB1'); $componentTag = $_instance->getRenderedChildComponentTagName('paI9nB1'); $html = \Livewire\Livewire::dummyMount($componentId, $componentTag); $_instance->preserveRenderedChild('paI9nB1'); } else { $response = \Livewire\Livewire::mount('store-list', []); $html = $response->html(); $_instance->logRenderedChild('paI9nB1', $response->id(), \Livewire\Livewire::getRootElementTagName($html)); } echo $html; ?> <?php endif;?> </div> <?php $__env->stopSection();?> <?php echo $__env->make('layouts.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render();?><?php /**PATH /var/www/moco/fassicms/resources/views/layouts/store-layout.blade.php ENDPATH**/?> ======================= File: app/Http/Livewire/Provider/ProviderList.php ======================= <filename>app/Http/Livewire/Provider/ProviderList.php <?php namespace App\Http\Livewire\Provider; use App\Models\Provider; use Illuminate\Database\Eloquent\Builder; use Illuminate\Support\Facades\Auth; use Illuminate\Support\HtmlString; use Rappasoft\LaravelLivewireTables\TableComponent; use Rappasoft\LaravelLivewireTables\Traits\HtmlComponents; use Rappasoft\LaravelLivewireTables\Views\Column; class ProviderList extends TableComponent { use HtmlComponents; public $edit = null; public Provider $provider; protected string $rowClass =''; protected array $rules = [ 'provider.name' =>'required', 'provider.enabled' =>'required', ]; /** * CustomerList constructor. * @param null $id */ public function __construct($id = null) { $this->perPage = config('moco.table.perPage'); $this->perPageOptions = config('moco.table.perPageOptions'); $this->loadingIndicator =true; $this->sortField = 'name'; $this->sortDefaultIcon = '<i class="fas fa-sort-alpha-down"></i>'; $this->ascSortIcon = '<i class="fas fa-sort-alpha-up"></i>'; $this->descSortIcon = '<i class="fas fa-sort-alpha-down"></i>'; $this->rowClass ='moco-row-table-height-small'; parent::__construct($id); } /** * Query * * @return Builder */ public function query(): Builder { return Provider::query(); } /** * Colonnes * * @return array */ public function columns(): array { return [ Column::make(trans('Provider name'),'name') ->sortable() ->searchable() ->format(function (Provider $model){ return $this->nameColumn($model); }), Column::make(trans('Enabled'),'enabled') ->sortable() ->searchable() ->format(function (Provider $model){ return $this->enabledColumn($model); }), Column::make(trans('Actions'),'actions') ->format(function (Provider $model){ return view('provider.provider-action',[ 'model' => $model, 'edit' => $this->edit == $model->id, ]); }) ]; } /** * Retourne la chaine de caractère pour editer le nom du fournisseur * * @param Provider $provider * @return HtmlString */ private function nameColumn(Provider $provider): HtmlString { $html = $provider->name; if ($this->edit == $provider->id) { $html = '<input wire:model.lazy="provider.name" class="form-control form-control-sm" type="text"/>'; } return $this->html($html); } /** * Retourne la chaine de caractère correspondant à un select * * @param $value * @return HtmlString */ function enabledColumn(Provider $provider): HtmlString { /** * contenu par dféaut sans le mode édite */ $html = $provider->enabled? trans('Yes') : trans('No'); if ($this->edit == $provider->id) { //$html = '<select wire:model.lazy="provider.enabled" class="form-control form-control-sm"><option value="1"'. ($provider->enabled?'selected' : ''). '>'. trans('Yes'). '</option><option value="0" '. (!$provider->enabled?'selected' : ''). '>'. trans('No'). '</option></select>'; $html = '<select wire:model.lazy="provider.enabled" class="form-control form-control-sm"><option value="1">'. trans('Yes'). '</option><option value="0">'. trans('No'). '</option></select>'; } return $this->html($html); } /** * @param $attribute * @return string|null */ public function setTableHeadClass($attribute):?string { $extend =''; switch ($attribute) { case 'enabled': $extend.='moco-size-column-table-100'; break; case 'actions': $extend.='moco-size-column-table-200'; break; } return'moco-title-table'.$extend; } public function setTableRowClass($model):?string { return $this->rowClass; } /** * On place la ligne en mode édite ou on retire le mode édite * * @param $id */ public function edit($id) { /** * Si la clé existe ou est différente on l'enregistre */ if($this->edit!= $id){ $this->edit = $id; $this->provider = Provider::find($id); } else { /** * la clé n'existe pas on la crée et attribue la valeur True */ $this->edit = null; $this->provider = new Provider(); } } /** * On sauvegarde les changements * * @param $id */ public function save($id) { /** * On valide */ $this->validate(); /** * s'il n'y a pas déjà un fournisseur avec le même nom on sauvegarde */ $this->provider->user()->associate(Auth::user()); $this->provider->save(); session()->flash('success',trans('The provider has been saved')); /** * Initialisation de l'edition */ $this->edit = null; $this->provider = new Provider(); } } ======================= File: storage/framework/views/4249ae2de851a6ea93eb0db16c73371a13f7c389.php ======================= <div class="d-flex flex-column" id="addcard"> <!-- s'il y a un Old Helper on affiche le contenu du old --> <?php if(old("contacts") === null):?> <?php $__currentLoopData = $customer->contacts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $contact): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop();?> <div class="border rounded p-3 mb-2" id="delete"> <input type="hidden" name="contacts[id][]" value="<?php echo e($contact->id);?>"> <div class="d-flex"> <div class="row w-100"> <!-- Firstname --> <div class="form-group col-6"> <label for="firstname"><?php echo e(__('Firstname'));?></label> <input type="text" class="form-control form-control-sm" name="contacts[firstname][]" id="firstname" value="<?php echo e($contact->firstname);?>" autocomplete="off" moco-validation-array="contacts"/> </div> <!-- Lastname --> <div class="form-group col-6"> <label for="lastname"><?php echo e(__('Lastname'));?></label> <input type="text" class="form-control form-control-sm" name="contacts[lastname][]" id="lastname" value="<?php echo e($contact->lastname);?>" autocomplete="off" moco-validation-array="contacts"/> </div> </div> <div><a href="#" id="remove"><i class="fas fa-trash-alt text-danger ml-2"></i></a></div> </div> <div class="row"> <!-- Function --> <div class="form-group col-4"> <label for="function"><?php echo e(__('Function'));?></label> <input type="text" class="form-control form-control-sm" name="contacts[function][]" id="function" value="<?php echo e($contact->function);?>" autocomplete="off" moco-validation-array="contacts"/> </div> <!-- Phone --> <div class="form-group col-4"> <label for="cphone"><?php echo e(__('Phone'));?></label> <input type="text" class="form-control form-control-sm" name="contacts[phone][]" id="phone" value="<?php echo e($contact->phone);?>" autocomplete="off" moco-validation-array="contacts"/> </div> <!-- Mobile --> <div class="form-group col-4"> <label for="cmobile"><?php echo e(__('Mobile'));?></label> <input type="text" class="form-control form-control-sm" name="contacts[mobile][]" id="mobile" value="<?php echo e($contact->mobile);?>" autocomplete="off" moco-validation-array="contacts"/> </div> </div> </div> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop();?> <?php else:?> <?php for($index = 0; $index < count(old('contacts')['id']); $index++):?> <div class="border rounded p-3 mb-2" id="delete"> <input type="hidden" name="contacts[id][]" value="<?php echo e(old('contacts')['id'][$index]);?>"> <div class="d-flex"> <div class="row w-100"> <!-- Firstname --> <div class="form-group col-6"> <label for="firstname"><?php echo e(__('Firstname'));?></label> <input type="text" class="form-control form-control-sm" name="contacts[firstname][]" id="firstname" value="<?php echo e(old('contacts')['firstname'][$index]);?>" autocomplete="off" moco-validation-array="contacts"/> </div> <!-- Lastname --> <div class="form-group col-6"> <label for="lastname"><?php echo e(__('Lastname'));?></label> <input type="text" class="form-control form-control-sm" name="contacts[lastname][]" id="lastname" value="<?php echo e(old('contacts')['lastname'][$index]);?>" autocomplete="off" moco-validation-array="contacts"/> </div> </div> <div><a href="#" id="remove"><i class="fas fa-trash-alt text-danger ml-2"></i></a></div> </div> <div class="row"> <!-- Function --> <div class="form-group col-4"> <label for="function"><?php echo e(__('Function'));?></label> <input type="text" class="form-control form-control-sm" name="contacts[function][]" id="function" value="<?php echo e(old('contacts')['function'][$index]);?>" autocomplete="off" moco-validation-array="contacts"/> </div> <!-- Phone --> <div class="form-group col-4"> <label for="cphone"><?php echo e(__('Phone'));?></label> <input type="text" class="form-control form-control-sm" name="contacts[phone][]" id="phone" value="<?php echo e(old('contacts')['phone'][$index]);?>" autocomplete="off" moco-validation-array="contacts"/> </div> <!-- Mobile --> <div class="form-group col-4"> <label for="cmobile"><?php echo e(__('Mobile'));?></label> <input type="text" class="form-control form-control-sm" name="contacts[mobile][]" id="mobile" value="<?php echo e(old('contacts')['mobile'][$index]);?>" autocomplete="off" moco-validation-array="contacts"/> </div> </div> </div> <?php endfor;?> <?php endif;?> </div> <a href="#" class="btn btn-success moco-btn-sm" id="addcontact"><?php echo e(__('Add contact'));?></a> <script id="template" type="text/html"> <div class="border rounded p-3 mb-2" id="delete"> <input type="hidden" name="contacts[id][]" value=""> <div class="d-flex"> <div class="row w-100"> <!-- Firstname --> <div class="form-group col-6"> <label for="firstname"><?php echo e(__('Firstname'));?></label> <input type="text" class="form-control form-control-sm" name="contacts[firstname][]" id="firstname_{{ uid }}" value="" autocomplete="off" moco-validation-array="contacts.firstname"/> </div> <!-- Lastname --> <div class="form-group col-6"> <label for="lastname"><?php echo e(__('Lastname'));?></label> <input type="text" class="form-control form-control-sm" name="contacts[lastname][]" id="lastname_{{ uid }}" value="" autocomplete="off" moco-validation-array="contacts.lastname"/> </div> </div> <div><a href="#" id="remove"><i class="fas fa-trash-alt text-danger ml-2"></i></a></div> </div> <div class="row"> <!-- Function --> <div class="form-group col-4"> <label for="function"><?php echo e(__('Function'));?></label> <input type="text" class="form-control form-control-sm" name="contacts[function][]" id="function_{{ uid }}" value="" autocomplete="off" moco-validation-array="contacts.function"/> </div> <!-- Phone --> <div class="form-group col-4"> <label for="cphone"><?php echo e(__('Phone'));?></label> <input type="text" class="form-control form-control-sm" name="contacts[phone][]" id="phone_{{ uid }}" value="" autocomplete="off" moco-validation-array="contacts.phone"/> </div> <!-- Mobile --> <div class="form-group col-4"> <label for="cmobile"><?php echo e(__('Mobile'));?></label> <input type="text" class="form-control form-control-sm" name="contacts[mobile][]" id="mobile_{{ uid }}" value="" autocomplete="off" moco-validation-array="contacts.mobile"/> </div> </div> </div> </script> <script type="text/javascript"> $(function (){ /** event sur le bouton ajouter un contact **/ $('#addcontact').on('click',() => { let uid = $.random(); console.log(uid); let data = {uid: uid}; let source = $('#template').html() let template = Handlebars.compile(source); $('#addcard').append(template(data)); }); /** event sur le bouton remove **/ $(document).on('click','#remove',function () { $(this).closest('#delete').remove(); }); $(document).on('keyup','#firstname',function() { let selector = $.escapeSelector("contacts.firstname"); $('[firstname]').each(function(index) { console.log($(this).val());}); }) }); </script> <?php /**PATH /var/www/moco/fassicms/resources/views/customer/customer-contact-form.blade.php ENDPATH**/?> ======================= File: resources/views/livewire/reassort/reassort-list-head.blade.php ======================= <reponame>smoers/fassicms <div class="d-flex flex-row justify-content-start mb-3 ml-3" style="vertical-align: center"> <div class="moco-color-info mr-2"><i class="fas fa-map-pin fa-2x"></i></div> <div> <select wire:model='locationId' id="location" class="form-control moco-row-table-font-small" data-width="fit" title="{{__('Select a Location')}}"> @foreach(App\Models\Location::all() as $location) <option value="{{$location->id}}" class="moco-row-table-font-small" >{{__($location->location)." : ".__($location->description)}}</option> @endforeach </select> </div> </div> ======================= File: database/factories/CatalogFactory.php ======================= <filename>database/factories/CatalogFactory.php <?php namespace Database\Factories; use App\Models\Catalog; use Illuminate\Database\Eloquent\Factories\Factory; class CatalogFactory extends Factory { /** * The name of the factory's corresponding model. * * @var string */ protected $model = Catalog::class; /** * Define the model's default state. * * @return array */ public function definition() { return [ 'price' => $this->faker->randomFloat(2,10,5000), 'year' => $this->faker->numberBetween(2018,2020), 'provider_id' => 5, ]; } } ======================= File: app/Models/ViewWorksheetCustomerCrane.php ======================= <?php namespace App\Models; use Carbon\Carbon; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class ViewWorksheetCustomerCrane extends Model { use HasFactory; public $table = 'view_worksheets_customers_cranes'; /** * Place la date avec le format correct dans l'attribut * * @param $value */ public function setDateAttribute($value) { $this->attributes['date'] = Carbon::parse(str_replace('/','-',$value)); } /** * Retourne la date au format correct * * @param $value * @return string|null */ public function getDateAttribute($value) { $return = null; if ($value!= ''){ $return = Carbon::parse($value)->format('d/m/Y'); } return $return; } } ======================= File: app/Models/Technician.php ======================= <reponame>smoers/fassicms <?php namespace App\Models; use App\Moco\Common\MocoModelCreatedUpdatedAt; use App\Moco\Common\MocoModelForConsultInterface; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use phpDocumentor\Reflection\Types\Boolean; class Technician extends Model implements MocoModelForConsultInterface { use HasFactory, MocoModelCreatedUpdatedAt; /** * Liste des relations utilisée pour le formulaire de consultation * * @var string[] */ protected $withForConsult = ['clockings','user']; /** * Retourne les objet Clocking liés à ce technicien * * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function clockings() { return $this->hasMany(Clocking::class); } /** * Retourne l'objet User lié à l'objet technicien * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function user() { return $this->belongsTo(User::class); } /** * Retourne null ou un object Technician * * @param string $number * @param bool $enabled * @return Technician|null */ public static function getTechnician(string $number, bool $enabled = true):?Technician { return self::where('number','=',$number)->where('enabled','=',$enabled)->first(); } public function WithForConsult() { return $this->withForConsult; } } ======================= File: app/Widgets/VersionInfo.php ======================= <?php namespace App\Widgets; use Arrilot\Widgets\AbstractWidget; class VersionInfo extends AbstractWidget { /** * The configuration array. * * @var array */ protected $config = []; /** * Treat this method as a controller action. * Return view() or other content to display. */ public function run() { $this->config(); return view('widgets.version_info', [ 'config' => $this->config, ]); } private function config(){ $this->config = [ 'title' => trans('Fassi Store Management System'), 'version' => config('moco.app.version'), 'release' => config('moco.app.release'), 'width' => '350px', 'height' => '200px', ]; } } ======================= File: storage/framework/views/c39ea395ef5f96c6605b582e47ef239c2b0724f2.php ======================= <gh_stars>0 <?php $__env->startSection('content');?> <div class="container p-5 h-100 moco-layout-height"> <div class="card"> <div class="card-header text-center font-weight-bold"> <h2 class="blue-grey-darker-hover"><?php echo e(__('Out of stock validation'));?></h2> </div> <div class="card-body"> <form name="part-form" id="part-form" method="post" action="<?php echo e(route('outworksheet.validation'));?>" moco-validation-table> <?php echo csrf_field();?> <div class="moco-table-wrapper-scroll-y moco-scrollbar"> <table class="table table-bordered table-striped"> <thead> <tr> <th><?php echo e(__('Part number'));?></th> <th><?php echo e(__('Qty'));?></th> </tr> </thead> <tbody> <?php $index = 0;?> <?php $__currentLoopData = $parts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $part): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop();?> <tr> <td> <input type="text" id="part_number<?php echo e($index);?>" name="part_number[]" class="form-control" value="<?php echo e(old('part_number',$part->part_number));?>" moco-validation-table> <div class="moco-error-small danger-darker-hover" id="part_number<?php echo e($index);?>Error"></div> </td> <td> <input type="number" id="qty<?php echo e($index);?>" name="qty[]" class="form-control" value="<?php echo e(old('qty',$part->qty));?>" moco-validation-table> <div class="moco-error-small danger-darker-hover" id="qty<?php echo e($index);?>Error"></div> </td> </tr> <?php $index++;?> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop();?> </tbody> </table> </div> <div class="d-flex justify-content-between"> <div> <button type="submit" class="btn btn-primary"><?php echo e(__('Validate'));?></button> </div> <div> <a href="<?php echo e(route('dashboard'));?>" class="btn btn-primary"><?php echo e(__('Cancel'));?></a> </div> </div> </form> </div> </div> <script type="text/javascript" src="<?php echo e(asset('js/moco.ajax.validation.js'));?>"></script> </div> <?php $__env->stopSection();?> <?php echo $__env->make('layouts.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render();?><?php /**PATH /var/www/moco/fassicms/resources/views/outworksheet/outworksheet-validation-form.blade.php ENDPATH**/?> ======================= File: app/Moco/Common/Moco.php ======================= <?php /* * Copyright (c) 2020. MO Consult * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Company : Fassi Belgium * Developer : MO Consult * Author : <NAME> * Date : 19/12/20 12:03 */ /** * Company : Fassi Belgium * Developer : MO Consult * Authority : <NAME> * Date : 19-12-20 */ namespace App\Moco\Common; use App\Models\Worksheet; use Carbon\Carbon; use Illuminate\Http\Request; use Illuminate\Support\Facades\Cookie; use phpDocumentor\Reflection\Types\Boolean; use PhpOffice\PhpSpreadsheet\Shared\Date; class Moco { /** * génére un numéro de fiche de travaille * * @return int */ public static function worksheetNumber(): int { return intval(Carbon::now('Europe/Brussels')->format('YmdHis')); } /** * Check si la worksheet existe and son status de validation * * @param Request $request * @return array */ public static function worksheetCheck(Request $request): array { $worksheet = Worksheet::where('number','=',$request->post('number'))->first(); if (!is_null($worksheet) &&!$worksheet->validated){ $result = [ 'checked' => true, 'id' => $worksheet->id, 'msg' => null, ]; } elseif (!is_null($worksheet) && $worksheet->validated){ $result = [ 'checked' => false, 'id' => $worksheet->id, 'msg' => trans('This worksheet is validated. No changes are authorized'), ]; } else { $result = [ 'checked' => false, 'id' => null, 'msg' => trans('This worksheet does not exist in the system'), ]; } return $result; } /** * génère un numéro de technicien unique * * @return string * @throws \Exception */ public static function technicianNumber(): string { $bytes = random_bytes(4); return bin2hex($bytes); } /** * gestion simplifée des cookies * * @param string $name * @param bool $remove * @param null $value * @return array|string|null */ public static function cookie(string $name, bool $remove = false, $value = null, $default = null) { if ($remove == false && $value == null){ return Cookie::get($name,$default); } elseif ($remove == false && $value!= null){ Cookie::queue($name,$value,2147483647); } elseif ($remove){ Cookie::queue(Cookie::forget($name)); } } /** * retourne une clé aléatoire * * @return string * @throws \Exception */ public static function randomKey(): string { $bytes = random_bytes(8); return bin2hex($bytes); } /** * Retourne un tableau avec la traduction * * @param array $array * @return array|null */ public static function translateArrayValue(array $array):?array { $result = []; foreach ($array as $key => $value){ array_push($result, trans($value)); } return $result; } /** * Converti en Float après avoir remplacé le ',' par '.' * * @param string $value * @return float|null */ public static function floatValReplace(string $value):?float { return floatval(str_replace(',','.',$value)); } /** * @param string $time * @param string $format * @return bool|float|int */ public static function timeToExcel(string $time, string $format = 'H:i') { $datetimeExcel = Date::PHPToExcel(Carbon::createFromFormat($format,$time)); return $datetimeExcel - floor($datetimeExcel); } } ======================= File: resources/lang/vendor/laravel-livewire-tables/nl/strings.php ======================= <gh_stars>0 <?php return [ 'clear' => 'Uitwissen', 'export' => 'Exporteren', 'loading' => 'Bezig met laden...', 'no_results' => 'Er zijn geen resultaten om weer te geven voor deze zoekopdracht.', 'offline' => 'U heeft momenteel geen verbinding met internet.', 'per_page' => 'Per Pagina', 'results' => ':first tot :last van :total resultaten weergegeven', 'search' => 'Zoeken...', ]; ======================= File: app/Http/Requests/CraneRequest.php ======================= <reponame>smoers/fassicms <?php namespace App\Http\Requests; use App\Moco\Common\MocoFormRequestAjaxValidation; use App\Rules\CraneUnique; use Illuminate\Foundation\Http\FormRequest; class CraneRequest extends FormRequest { use MocoFormRequestAjaxValidation; /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ 'serial' => ['required','max:20',new CraneUnique($this->getRequestArray())], 'model' =>'required|max:255', 'plate' => ['required','max:20',new CraneUnique($this->getRequestArray())] ]; } public function messages() { return [ 'max' => trans('The maximum size for :attribute is :max chraracters'), 'required' => trans('The :attribute is required'), ]; } public function attributes() { return [ 'serial' => trans('Serial number'), 'model' => trans('Model'), 'plate' => trans('Numberplate'), ]; } } ======================= File: resources/views/worksheet/clocking-form.blade.php ======================= <gh_stars>0 @extends('layouts.layout') @section('content') <div class="container p-5 h-100 moco-layout-height" style="min-width: 50vw"> <div class="card"> <div class="card-header text-center font-weight-bold"> <h2 class="blue-grey-darker-hover">{{__('Edit clocking')}}</h2> </div> <div class="card-body"> <div class="d-flex justify-content-between mb-5"> <div class="d-flex flex-row"> <div class="mr-2">{{__('Date')}} :</div> <div class="mr-2">{{$worksheet->date}}</div> </div> <div class="d-flex flex-row"> <div class="mr-2">{{__('Number')}} :</div> <div class="mr-2 moco-color-error">{{$worksheet->number}}</div> </div> </div> <div class="row"> <!-- Technician --> <div class="col-md-3"> <div class="form-group"> <label for="technician_id">{{__('Technician')}}</label> <select id="technician_id" name="technician_id" class="form-control form-control-sm"> <option></option> @foreach($technicians as $technician) <option value="{{$technician->id}}">{{$technician->lastname.' '.$technician->firstname}}</option> @endforeach </select> </div> </div> <div class="col-md-2"> <div class="form-group"> <label for="start_date">{{__('Start date')}}</label> <div class="input-group mb-3"> <input type="text" id="start_date" name="start_date" class="form-control form-control-sm" autocomplete="off" placeholder="{{__('DD/MM/YYYY')}}" aria-label="date" aria-describedby="basic-addon1" value=""/> <div class="input-group-prepend"> <span class="input-group-text" id="basic-addon1"><i class="fa fa-calendar-alt"></i></span> </div> </div> </div> </div> <div class="col-md-2"> <div class="form-group"> <label for="start_time">{{__('Start time')}}</label> <input type="time" id="start_time" name="start_time" class="form-control form-control-sm" placeholder="" value=""/> </div> </div> <div class="col-md-2"> <div class="form-group"> <label for="stop_time">{{__('Stop time')}}</label> <input type="time" id="stop_time" name="stop_time" class="form-control form-control-sm" placeholder="" value=""/> </div> </div> <div class="col-md-2"> <div class="form-group"> <label for="diff">{{__('Difference')}}</label> <input type="time" id="diff" name="diff" readonly class="form-control form-control-sm bg-white" placeholder="" value=""/> </div> </div> <div class="col-md-1" style="margin-top:35px;"> <a href="#" id="_add"><i class="fas fa-plus-circle fa-lg mt-2"></i> </a> </div> </div> <form name="clocking-form" id="clocking-form" method="post" action="{{$action}}"> @csrf <table class="table table-sm table-striped" id="table_clocking"> <tbody id="addRow"> @foreach($clockings as $clocking) <tr id="_delete"> <td> <input type="hidden" name="id[]" value="{{ $clocking->id }}"> <input type="hidden" name="technician_id[]" value="{{ $clocking->technician_id }}"/> <i class="fas fa-edit fa-lg mt-2" style="color: green!important;"></i> </td> <td> <input type="text" class="form-control form-control-sm bg-white" readonly name="lastname[]" value="{{ $clocking->technician->lastname }} {{ $clocking->technician->firstname }}"/> </td> <td> <input type="text" class="form-control form-control-sm bg-white" readonly name="start_date[]" value="{{ $clocking->getStartDate() }}"/> </td> <td> <input type="time" class="form-control form-control-sm bg-white" id="start_time_{{ $clocking->id }}" name="start_time[]" value="{{ $clocking->getStartTime() }}"/> </td> <td> <input type="time" class="form-control form-control-sm bg-white" id="stop_time_{{ $clocking->id }}" name="stop_time[]" value="{{ $clocking->getStopTime() }}"/> </td> <td> <input type="time" class="form-control form-control-sm bg-white" readonly id="diff_{{ $clocking->id }}" name="diff[]" value="{{ $clocking->getDiff() }}"/> </td> <td> <a href="#" id="_remove"><i class="fas fa-trash fa-lg mt-2" style="color: red!important;"></i></a> </td> </tr> @endforeach </tbody> </table> <div class="d-flex justify-content-end mb-3"> <div class="mr-3 mt-2 moco-color-error">{{__('Total')}}</div> <div class="mr-5"><input type="text" id="total" class="form-control form-control-sm bg-white moco-color-error" readonly value="" /></div> </div> <div class="d-flex justify-content-between"> <div> <button type="submit" class="btn btn-primary">{{__('Save')}}</button> </div> <div> <a href="{{ route('worksheet.index') }}" class="btn btn-primary">{{__('Cancel')}}</a> </div> </div> </form> </div> </div> </div> <script id="document-template" type="text/x-handlebars-template"> <tr id="_delete"> <td> <input type="hidden" name="id[]" value=""> <input type="hidden" name="technician_id[]" value="@{{ technician_id }}"/> </td> <td> <input type="text" class="form-control form-control-sm bg-white" readonly name="lastname[]" value="@{{ lastname }}"/> </td> <td> <input type="text" class="form-control form-control-sm bg-white" readonly name="start_date[]" value="@{{ start_date }}"/> </td> <td> <input type="time" class="form-control form-control-sm bg-white" readonly name="start_time[]" value="@{{ start_time }}"/> </td> <td> <input type="time" class="form-control form-control-sm bg-white" readonly name="stop_time[]" value="@{{ stop_time }}"/> </td> <td> <input type="time" class="form-control form-control-sm bg-white" id="diff_" readonly name="diff[]" value="@{{ diff }}"/> </td> <td> <a href="#" id="_remove"><i class="fas fa-trash fa-lg mt-2" style="color: red!important;"></i></a> </td> </tr> </script> <script src="{{ asset('3rd/bootstrap-datepicker-1.9.0-dist/locales/bootstrap-datepicker.fr.min.js')}}"></script> <script src="{{ asset('3rd/bootstrap-datepicker-1.9.0-dist/locales/bootstrap-datepicker.nl-BE.min.js')}}"></script> <script type="text/javascript"> $(function () { /* * Date picker */ $('#start_date').datepicker({ format: 'dd/mm/yyyy', orientation: 'bottom auto', language: 'fr', todayBtn: "linked", autoclose: true, }); /* * Event sur l'heure de début */ $('#start_time').on('change', function () { setDiff(''); }) /* * Event sur l'heure de fin * */ $('#stop_time').on('change', function () { setDiff(''); }) /* * Event sur les enregistrements qui peuvent être modifié * */ $('[id*=_time_]').on('change', function() { setDiff('_'+$(this).prop('id').match(/[0-9]+/g)); setTotal(); }) /* * Intialise * */ setTotal(); /* * Chargement du tableau */ $('#_add').on('click', function () { if ($('#technician_id').val()!= "" && $('#start_date').val()!= "" && $('#start_time').val()!= "" && $('#stop_time')!= "") { /* * Récupère le texte du select */ var select = document.getElementById("technician_id"); /* * Chargement des valeurs */ var technician_id = $('#technician_id').val(); var lastname = select.options[select.selectedIndex].text; var start_date = $('#start_date').val(); var start_time = $('#start_time').val(); var stop_time = $('#stop_time').val(); var diff = $('#diff').val(); var source = $('#document-template').html(); var template = Handlebars.compile(source); /* * object pour le Handlebars */ var data = { technician_id: technician_id, lastname: lastname, start_date: start_date, start_time: start_time, stop_time: stop_time, diff: diff } /* *Charge les valeurs dans la nouvelle ligne */ var html = template(data); /* * Affiche la nouvelle ligne */ $('#addRow').append(html); /* * cleanup */ $('#technician_id').val(""); $('#start_date').val(""); $('#start_time').val(""); $('#stop_time').val(""); $('#diff').val(""); /* * Total * */ setTotal(); } }) /** * Supprime une ligne du tableau */ $(document).on('click', "#_remove", function (event) { $(this).closest("#_delete").remove(); setTotal(); }) }) /* * Calul et affiche la différence */ function setDiff(index) { let startTime = moment($('#start_time'+index).val(), "HH:mm"); let stopTime = moment($('#stop_time'+index).val(), "HH:mm"); if (startTime.isValid() && stopTime.isValid() && startTime.isBefore(stopTime)) { $('#diff'+index).val(moment.utc(stopTime.diff(startTime)).format("HH:mm")); } else { $("#diff"+index).val(""); } } /* * Calcul le total du temps * */ function setTotal(){ let sum = moment.duration(); $('[id^=diff_]').each(function(){ let value = $(this).val(); sum.add(value); }) let hours = Math.trunc(sum.asHours()); let minutes = Math.round((sum.asHours() - hours) * 60); $('#total').val(hours+':'+minutes); } </script> @endsection ======================= File: routes/web.php ======================= <?php use App\Http\Controllers\Auth\ChangePasswordController; use App\Http\Controllers\ProviderController; use App\Http\Controllers\ReportController; use Illuminate\Support\Facades\Route; use App\Http\Controllers\DashboardController; use App\Http\Controllers\StoreController; use App\Http\Controllers\CraneController; use App\Http\Controllers\ReassortController; use App\Http\Controllers\OutController; use App\Http\Controllers\CustomerController; use App\Http\Controllers\OutWorksheetController; use App\Http\Controllers\WorksheetController; use App\Http\Controllers\ClockingController; use App\Http\Controllers\Auth\LoginController; use App\Http\Controllers\TechnicianController; /* |-------------------------------------------------------------------------- | Web Routes |-------------------------------------------------------------------------- | | Here is where you can register web routes for your application. These | routes are loaded by the RouteServiceProvider within a group which | contains the "web" middleware group. Now create something great! | */ //Auth::routes(); Route::get('/login',[LoginController::class,'showLoginForm'])->name('login'); Route::post('/login',[LoginController::class,'login']); Route::post('/login/setcookie',[LoginController::class,'setCookie'])->name('login.setcookie'); Route::post('/logout',[LoginController::class,'logout'])->name('logout'); //Route::get('/permissions',[PermissionController::class,'add'])->name('permissions.add'); Route::group(['middleware' => ['auth']],function (){ Route::get('/', function () { return redirect()->route('dashboard'); })->name('main'); /** * Change Password Controller */ Route::post('/cpassword/current',[ChangePasswordController::class,'ajaxCheckCurrentPassword'])->name('password.checkcurrent')->middleware(['ifnot:password change']); Route::post('/cpassword/format',[ChangePasswordController::class,'ajaxCheckFormatPassword'])->name('password.format')->middleware(['ifnot:password change']); Route::post('/cpassword/store',[ChangePasswordController::class,'ajaxStorePassword'])->name('password.store')->middleware(['ifnot:password change']); /** * Dashboard Controller */ Route::get('/dashboard', [DashboardController::class, 'index'])->name("dashboard"); Route::get('/home', [DashboardController::class, 'index'])->name("home"); /** * Crane Controller */ Route::get('/crane',[CraneController::class,'index'])->name('crane.index')->middleware(['ifnot:list crane']); Route::get('/crane/create',[CraneController::class,'create'])->name('crane.create')->middleware(['ifnot:create crane']); Route::get('/crane/{id}/edit',[CraneController::class,'edit'])->name('crane.edit')->middleware(['ifnot:edit crane']); Route::get('/crane/{id}/show',[CraneController::class,'show'])->name('crane.show')->middleware(['ifnot:consult crane']); Route::post('/crane/store',[CraneController::class,'store'])->name('crane.store')->middleware(['ifnot:create crane']); Route::post('/crane/{id}/update',[CraneController::class,'update'])->name('crane.update')->middleware(['ifnot:edit crane']); Route::post('/crane/ajaxvalidation',[CraneController::class,'ajaxValidation'])->name('crane.ajaxvalidation')->middleware(['ifnot:create crane|edit crane']); /** * Store Controller */ Route::get('store',[StoreController::class,'index'])->name('store.index')->middleware(['ifnot:list catalog']); Route::get('/store/create',[StoreController::class,'create'])->name('store.create')->middleware(['ifnot:create catalog']); Route::post('/store/store',[StoreController::class,'store'])->name('store.store')->middleware(['ifnot:create catalog']); Route::post('/store/update',[StoreController::class,'update'])->name('store.update')->middleware(['ifnot:edit catalog']); Route::get('/store/{id}/{cat_id}/edit',[StoreController::class,'edit'])->name('store.edit')->middleware(['ifnot:edit catalog']); Route::post('/store/ajaxvalidation',[StoreController::class,'ajaxValidation'])->name('store.ajaxvalidation')->middleware(['ifnot:create catalog|edit catalog']); Route::get('/store/{id}/bs',[StoreController::class,'barcodeSticker'])->name('store.barcode_sticker')->middleware(['ifnot:print catalog']); Route::get('/store/{id}/show',[StoreController::class,'show'])->name('store.show')->middleware(['ifnot:consult catalog']); /** * Reassort Controller */ Route::get('/reassort',[ReassortController::class,'index'])->name('reassort.index')->middleware(['ifnot:list stock']); Route::get('/reassort/{id}/edit',[ReassortController::class,'edit'])->name('reassort.edit')->middleware(['ifnot:reassort stock']); Route::post('/reassort/update',[ReassortController::class,'update'])->name('reassort.update')->middleware(['ifnot:reassort stock']); Route::post('/reassort/ajaxvalidation',[ReassortController::class,'ajaxValidation'])->name('reassort.ajaxvalidation')->middleware(['ifnot:reassort stock']); Route::post('/reassort/ajaxreassortcheck',[ReassortController::class,'ajaxReassortCheck'])->name('reassort.ajaxreassortcheck')->middleware(['ifnot:reassort stock']); /** * Out Controller */ Route::get('/out/{id}/edit',[OutController::class,'edit'])->name('out.edit')->middleware(['ifnot:out stock']); Route::post('/out/update',[OutController::class,'update'])->name('out.update')->middleware(['ifnot:out stock']); Route::post('/out/ajaxvalidation',[OutController::class,'ajaxValidation'])->name('out.ajaxvalidation')->middleware(['ifnot:out stock']); Route::post('/out/ajaxoutcheck',[OutController::class,'ajaxOutCheck'])->name('out.ajaxoutcheck')->middleware(['ifnot:out stock']); /** * Customer Controller */ Route::get('/customer',[CustomerController::class,'index'])->name('customer.index')->middleware(['ifnot:list customer']); Route::get('/customer/create',[CustomerController::class,'create'])->name('customer.create')->middleware(['ifnot:create customer']); Route::get('/customer/{id}/edit',[CustomerController::class,'edit'])->name('customer.edit')->middleware(['ifnot:edit customer']); Route::get('/customer/{id}/show',[CustomerController::class,'show'])->name('customer.show')->middleware(['ifnot:consult customer']); Route::post('/customer/store',[CustomerController::class,'store'])->name('customer.store')->middleware(['ifnot:create customer']); Route::post('/customer/{id}/update',[CustomerController::class,'update'])->name('customer.update')->middleware(['ifnot:edit customer']); Route::post('/customer/ajaxvalidation',[CustomerController::class,'ajaxValidation'])->name('customer.ajaxvalidation')->middleware(['ifnot:create customer|edit customer']); Route::post('/customer/ajaxselect',[CustomerController::class,'ajaxSelect'])->name('customer.ajaxselect')->middleware(['ifnot:create customer|edit customer']); /** * OutWorksheet Controller */ Route::get('/outworksheet/in',[OutWorksheetController::class,'in'])->name('outworksheet.in')->middleware(['ifnot:reassort worksheet stock']); Route::get('/outworksheet/out',[OutWorksheetController::class,'out'])->name('outworksheet.out')->middleware(['ifnot:out worksheet stock']); Route::post('/outworksheet/in',[OutWorksheetController::class,'inTreatment'])->name('outworksheet.intreatment')->middleware(['ifnot:reassort worksheet stock']); Route::post('/outworksheet/out',[OutWorksheetController::class,'outTreatment'])->name('outworksheet.outtreatment')->middleware(['ifnot:out worksheet stock']); Route::post('/outworksheet/ajaxworksheetcheck',[OutWorksheetController::class,'ajaxWorksheetCheck'])->name('outworksheet.ajaxworksheetcheck')->middleware(['ifnot:reassort worksheet stock|reassort worksheet stock']); Route::post('/outworksheet/ajaxpartcheck',[OutWorksheetController::class,'ajaxPartCheck'])->name('outworksheet.ajaxpartcheck')->middleware(['ifnot:reassort worksheet stock|reassort worksheet stock']); Route::post('/outworksheet/ajaxpartcheckout',[OutWorksheetController::class,'ajaxPartCheckOut'])->name('outworksheet.ajaxpartcheckout')->middleware(['ifnot:reassort worksheet stock|reassort worksheet stock']); Route::post('/outworksheet/ajaxpartqtycheck',[OutWorksheetController::class,'ajaxPartQtyCheck'])->name('outworksheet.ajaxpartqtycheck')->middleware(['ifnot:reassort worksheet stock|reassort worksheet stock']); /** * Worksheet Controller */ Route::get('/worksheet/index',[WorksheetController::class,'index'])->name('worksheet.index')->middleware(['ifnot:list worksheet']); Route::get('/worksheet/create',[WorksheetController::class,'create'])->name('worksheet.create')->middleware(['ifnot:create worksheet']); Route::get('/worksheet/template',[WorksheetController::class,'templateCreate'])->name('worksheet.template.create')->middleware(['ifnot:create worksheet']); Route::post('/worksheet/template',[WorksheetController::class,'templateStore'])->name('worksheet.template.store')->middleware(['ifnot:create worksheet']); Route::get('/worksheet/{id}/edit',[WorksheetController::class,'edit'])->name('worksheet.edit')->middleware(['ifnot:edit worksheet']); Route::get('/worksheet/{id}/part',[WorksheetController::class,'partConsult'])->name('worksheet.part')->middleware(['ifnot:part worksheet']); Route::get('/worksheet/{id}/show',[WorksheetController::class,'show'])->name('worksheet.show')->middleware(['ifnot:consult worksheet']); Route::get('/worksheet/{id}/export',[WorksheetController::class,'export'])->name('worksheet.export')->middleware(['ifnot:consult worksheet']); Route::post('/worksheet/print',[WorksheetController::class,'print'])->name('worksheet.print')->middleware(['ifnot:print worksheet']); Route::post('/worksheet/store',[worksheetController::class,'store'])->name('worksheet.store')->middleware(['ifnot:create worksheet']); Route::post('/worksheet/{id}/update',[worksheetController::class,'update'])->name('worksheet.update')->middleware(['ifnot:edit worksheet']); Route::post('/worksheet/ajaxselect',[WorksheetController::class,'ajaxSelect'])->name('worksheet.ajaxselect')->middleware(['ifnot:create worksheet|edit worksheet']); Route::post('/worksheet/ajaxvalidation',[WorksheetController::class,'ajaxValidation'])->name('worksheet.ajaxvalidation')->middleware(['ifnot:create worksheet|edit worksheet']); Route::post('/worksheet/addoption',[WorksheetController::class,'addOption'])->name('worksheet.add.option')->middleware(['ifnot:create worksheet|edit worksheet']); /** * Clocking Controller */ Route::get('/clocking/{id}/edit',[ClockingController::class,'edit'])->name('clocking.edit')->middleware(['ifnot:clocking worksheet']); Route::get('/clocking/correct',[ClockingController::class,'correct'])->name('clocking.correct')->middleware(['ifnot:clocking correction']); Route::post('/clocking/ajaxcorrect',[ClockingController::class,'ajaxCorrect'])->name('clocking.ajaxcorrect')->middleware(['ifnot:clocking correction']); //Route::get('/clocking/{id}/show',[ClockingController::class,'show'])->name('clocking.show'); Route::get('/clocking/clockingtechnician',[ClockingController::class,'ClockingTechnician'])->name('clocking.technician')->middleware(['ifnot:clocking technician']); Route::post('/clocking/{id}/update',[ClockingController::class,'update'])->name('clocking.update')->middleware(['ifnot:clocking worksheet']); Route::post('/clocking/ajaxworksheetcheck',[ClockingController::class,'ajaxWorksheetCheck'])->name('clocking.ajaxworksheetcheck')->middleware(['ifnot:clocking technician']); Route::post('/clocking/ajaxtechniciancheck',[ClockingController::class,'ajaxTechnicianCheck'])->name('clocking.ajaxtechniciancheck')->middleware(['ifnot:clocking technician']); /** * Technician Controller */ Route::get('/technician',[TechnicianController::class,'index'])->name('technician.index')->middleware(['ifnot:list technician']); Route::get('/technician/create',[TechnicianController::class,'create'])->name('technician.create')->middleware(['ifnot:create technician']); Route::get('/technician/{id}/edit',[TechnicianController::class,'edit'])->name('technician.edit')->middleware(['ifnot:edit technician']); Route::get('/technician/{id}/show',[TechnicianController::class,'show'])->name('technician.show')->middleware(['ifnot:consult technician']); Route::post('/technician/store',[TechnicianController::class,'store'])->name('technician.store')->middleware(['ifnot:create technician']); Route::post('/technician/{id}/update',[TechnicianController::class,'update'])->name('technician.update')->middleware(['ifnot:edit technician']); Route::post('/technician/ajaxvalidation',[TechnicianController::class,'ajaxValidation'])->name('technician.ajaxvalidation')->middleware(['ifnot:create technician|edit technician']); Route::post('/technician/ajaxnamecheck',[TechnicianController::class,'ajaxNameCheck'])->name('technician.ajaxnamecheck')->middleware(['ifnot:create technician|edit technician']); /** * Provider Controller */ Route::get('/provider',[ProviderController::class,'index'])->name('provider.index')->middleware(['ifnot:list provider']); /** * Reports */ Route::get('/report/reassort',[ReportController::class,'reassortLevel'])->name('report.reassortLevel')->middleware(['ifnot:list provider']); }); ======================= File: app/Models/Store.php ======================= <filename>app/Models/Store.php <?php /* * Copyright (c) 2020. MO Consult * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Company : Fassi Belgium * Developer : MO Consult * Authority : <NAME> * Date : 08-11-20 */ namespace App\Models; use App\Moco\Common\MocoModelCreatedUpdatedAt; use Carbon\Carbon; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\Auth; class Store extends Model { use HasFactory, MocoModelCreatedUpdatedAt; protected $fillable = [ 'qty', 'location', ]; /** * Retourne l'objet Partmetadata lié à l'objet Store * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function partmetadata() { return $this->belongsTo(Partmetadata::class); } /** * Retourne l'objet Location lié à l'objet Store * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function location() { return $this->belongsTo(Location::class); } /** * Retourne l'objet User lié à l'objet Store * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function user() { return $this->belongsTo(User::class); } /** * Retourne les objets Reassortement pour cet objet Store * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function reassortements(){ return $this->hasMany(Reassortement::class); } /** * Retourne les objets Out pour cet objet Store * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function outs(){ return $this->hasMany(Out::class); } /* * Convertir en format MySQL */ public function setQtyAttribute($value) { $this->attributes['qty'] = intval($value); } /** * @param $value * @return string|null */ public function getQtyAttribute($value) { if($value == ''){ return '0'; } else { return number_format(intval($value),0,',',''); } } /** * Retourne la quantité pour une année précisée * * @param int|null $year * @return int|null */ public function getPrice(int $year = null) { $catalog = $this->partmetadata()->first()->getCatalog($year); return is_null($catalog)? null : $catalog->price; } /** * @param int $inc_qty */ public function increaseQuantity(int $inc_qty) { $this->attributes['qty'] += $inc_qty; } /** * @param int $dec_qty */ public function decreaseQuantity(int $dec_qty) { if ($this->validateAvailableQuantity($dec_qty)){ $this->attributes['qty'] -= $dec_qty; } } /** * @param int $qty_pull * @return bool */ public function validateAvailableQuantity(int $qty_pull) { return $qty_pull <= $this->attributes['qty']; } /** * Va retourner un objet Out hydraté et * mets à jour l'objet Store au niveau de la quantité * * @param int $qty_pull * @param Reason|null $reason * @param string|null $note * @return Out|null */ public function getOutHydrated(int $qty_pull, Reason $reason = null, string $note = null):? Out { $out = null; if ($this->validateAvailableQuantity($qty_pull)){ $out = new Out(); $out->qty_pull = $qty_pull; $out->qty_before = $this->attributes['qty']; $out->reason()->associate($reason); $out->store()->associate($this); $out->user()->associate(Auth::user()); $out->note = $note; $this->decreaseQuantity($qty_pull); } return $out; } /** * Va retourner un objet Reassortement hydraté et * mets à jour l'objet Store au niveau de la quantité * * @param int $qty_add * @param Reason|null $reason * @param string|null $note * @return Reassortement|null */ public function getReassortementHydrated(int $qty_add, Reason $reason = null, string $note = null):?Reassortement { $reassort = new Reassortement(); $reassort->qty_add = $qty_add; $reassort->qty_before = $this->attributes['qty']; $reassort->note = $note; $reassort->store()->associate($this); $reassort->user()->associate(Auth::user()); $reassort->reason()->associate($reason); $this->increaseQuantity($qty_add); return $reassort; } /** * Détermine si un part number exist * * @param string $part_number * @param bool $enabled * @return bool */ public static function exist(string $part_number, bool $enabled = true): bool { return self::where('part_number','=', $part_number)->where('enabled','=',$enabled)->get()->count()== 1 ; } /** * Détermine si le code barre existe dans la table * * @param string $bar_code * @param bool $enabled * @return bool */ public static function existBarCode(string $bar_code, bool $enabled = true): bool { return self::where('bar_code','=', $bar_code)->where('enabled','=',$enabled)->get()->count()== 1 ; } /** * Retourne l'objet Store sur base du part number * * @param string $part_number * @param int $location_id * @param bool $enabled * @param bool $lockForUpdate * @return mixed */ public static function getStoreByPartNumber(string $part_number, int $location_id, bool $enabled = true, bool $lockForUpdate = false):?Store { $partmetadata = Partmetadata::getPartmetadataByPartNumber($part_number, $enabled); if (!is_null($partmetadata)) return $partmetadata->getStoreByLocation($location_id,$lockForUpdate); else return null; } /** * Retourne l'objet Store sur base du code barre * * @param string $bar_code * @param int $location_id * @param bool $enabled * @param bool $lockForUpdate * @return mixed */ public static function getStoreByBarCode(string $bar_code, int $location_id, bool $enabled = true, bool $lockForUpdate = false):?Store { $partmetadata = Partmetadata::getPartmetadataByBarCode($bar_code, $enabled); if (!is_null($partmetadata)) return $partmetadata->getStoreByLocation($location_id,$lockForUpdate); else return null; } } ======================= File: storage/framework/views/cab0d3c62bf65fa32dc17ea4a18ce8a4372d615e.php ======================= <?php $__env->startSection('content');?> <div class="container p-5 h-100 moco-layout-height" style="min-width: 50vw"> <div class="card"> <div class="card-header text-center font-weight-bold"> <h2 class="blue-grey-darker-hover"><?php echo e($title);?></h2> </div> <div class="card-body"> <div class="d-flex justify-content-around"> <div class="d-flex justify-content-center"> <div><?php echo e(__('Number of worksheet'));?> : </div> <div><input type="number" id="nbr" name="nbr" class="form-control ml-3" value="0"></div></div> <div><a href="#" class="btn btn-danger"><?php echo e(__('Launch'));?></a> </div> </div> </div> </div> </div> <?php $__env->stopSection();?> <?php echo $__env->make('layouts.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render();?><?php /**PATH /var/www/moco/fassicms/resources/views/worksheet/worksheet-mass-create.blade.php ENDPATH**/?> ======================= File: app/Http/Controllers/ReportController.php ======================= <reponame>smoers/fassicms <?php namespace App\Http\Controllers; use App\Reports\ReassortLevel; use Illuminate\Http\Request; class ReportController extends Controller { public function reassortLevel() { $report = new ReassortLevel(); $report->run(); return view('reports.reassort-level',['report' => $report]); } } ======================= File: resources/views/widgets/template.blade.php ======================= <div class="card mr-3 mb-3 moco-widget" style="width: {{$config['width']}};height: {{$config['height']}}"> <div class="card-body"> <div class="card-title moco-title-table">{{$config['title']}}</div> <div class="card-body"> @yield('body') </div> </div> </div> ======================= File: app/Models/Part.php ======================= <?php /* * Copyright (c) 2020. MO Consult * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Company : Fassi Belgium * Developer : MO Consult * Author : <NAME> * Date : 4/12/20 14:31 */ namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Part extends Model { use HasFactory; protected $fillable = [ 'part_number', 'bar_code', 'qty', ]; /** * Retourne le User lié à cette object * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function user() { return $this->belongsTo(User::class); } /** * Retourne le Worksheet lié à cette object * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function worksheet() { return $this->belongsTo(Worksheet::class); } /** * Retourne la location pour cette pièce * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function location() { return $this->belongsTo(Location::class); } /* * Convertir en format MySQL */ public function setQtyAttribute($value) { $this->attributes['qty'] = intval($value); } /** * @param $value * @return string|null */ public function getQtyAttribute($value) { if($value == ''){ return null; } else { return number_format(intval($value),0,',','.'); } } /* * Convertir en format MySQL */ public function setPriceAttribute($value) { $this->attributes['price'] = floatval(str_replace(',','.',$value)); } /** * @param $value * @return string|null */ public function getPriceAttribute($value) { if($value == ''){ return null; } else { return number_format(floatval(str_replace(',', '.', $value)), 2, ',', '.'); } } public function getTotal():?string { if (is_null($this->attributes['qty']) || is_null($this->attributes['price'])){ return null; } else { return number_format(intval($this->attributes['qty'])* floatval($this->attributes['price']),2,',','.'); } } } ======================= File: storage/framework/views/357f0130539d550c00ec9e0977bbe4e857371e51.php ======================= <?php $__env->startSection('content');?> <div class="container p-5 h-100 moco-layout-height"> <div class="card"> <div class="card-header text-center font-weight-bold"> <h2 class="blue-grey-darker-hover"><?php echo e($title);?></h2> </div> <div class="card-body"> <form name="part-form" id="part-form" method="post" action="<?php echo e($_action);?>" moco-validation> <?php echo csrf_field();?> <input type="hidden" id="id" name="id" value="<?php echo e($partmetadata->id);?>"> <input type="hidden" id="cat_id" name="cat_id" value="<?php echo e($catalog->id);?>"> <input type="hidden" id="new_provider_name" name="new_provider_name" value="<?php echo e(old('new_provider_name'));?>"> <div class="row"> <div class="col-6"> <!-- Part Number--> <div class="form-group"> <label for="part_number"><?php echo e(__('Part Number'));?></label> <input type="text" id="part_number" name="part_number" class="form-control" <?php if($partmetadata->id!= null):?> readonly <?php endif;?> value="<?php echo e(old('part_number', $partmetadata->part_number));?>" moco-validation> <div class="moco-error-small danger-darker-hover" id="part_numberError"></div> </div> </div> <div class="col-6"> <!-- Bar Code--> <div class="form-group"> <label for="part_number"><?php echo e(__('Bar Code'));?></label> <input type="text" id="bar_code" name="bar_code" class="form-control" value="<?php echo e(old('bar_code', $partmetadata->bar_code));?>" moco-validation> <div class="moco-error-small danger-darker-hover" id="bar_codeError"></div> </div> </div> </div> <div class="row"> <div class="col-10"> <!-- Description --> <div class="form-group"> <label for="description"><?php echo e(__('Description'));?></label> <input type="text" id="description" name="description" class="form-control" value="<?php echo e(old('description', $partmetadata->description));?>" moco-validation /> <div class="moco-error-small danger-darker-hover" id="descriptionError"></div> </div> </div> <div class="col-2"> <!-- Electrical Part --> <div class="d-flex flex-column"> <div><?php echo e(__('Electrical Part'));?></div> <div> <select id="electrical_part" name="electrical_part" class="selectpicker form-control" data-width="fit" title="<?php echo e(__('Electrical'));?>" moco-validation> <option value="1" <?php if(old('electrical_part',$partmetadata->electrical_part) == 1):?> selected <?php endif;?>><?php echo e(__('Yes'));?></option> <option value="0" <?php if(old('electrical_part',$partmetadata->electrical_part) == 0):?> selected <?php endif;?>><?php echo e(__('No'));?></option> </select> <div class="moco-error-small danger-darker-hover" id="electrical_partError"></div> </div> </div> </div> </div> <!-- Sur une ligne--> <div class="row"> <!-- Reassort Level --> <div class="col-2"> <div class="form-group"> <label for="reassort_level"><?php echo e(__('Reassort Level'));?></label> <input type="number" id="reassort_level" name="reassort_level" class="form-control" value="<?php echo e(old('reassort_level', $partmetadata->reassort_level));?>" moco-validation /> <div class="moco-error-small danger-darker-hover" id="reassort_levelError"></div> </div> </div> <?php if($partmetadata->id == null):?> <!-- Quantity --> <div class="col-2"> <div class="form-group"> <label for="qty"><?php echo e(__('Quantity'));?></label> <input type="number" id="qty" name="qty" class="form-control" value="<?php echo e(old('qty', $store->qty));?>" moco-validation/> <div class="moco-error-small danger-darker-hover" id="qtyError"></div> </div> </div> <!-- Location --> <div class="col-4"> <div class="d-flex flex-column"> <div><?php echo e(__('Location'));?></div> <div> <select id="location_id" name="location_id" class="selectpicker form-control" data-width="fit" title="<?php echo e(__('Select a Location'));?>" moco-validation> <?php $__currentLoopData = App\Models\Location::all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $location): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop();?> <option value="<?php echo e($location->id);?>" <?php if(old('location_id',$store->location_id) == $location->id):?> selected <?php endif;?>><?php echo e(__($location->location)." : ".__($location->description));?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop();?> </select> <div class="moco-error-small danger-darker-hover" id="location_idError"></div> </div> </div> </div> <?php endif;?> <!-- Price --> <div class="col-2"> <div class="form-group"> <label for="price"><?php echo e(__('Price'));?></label> <input type="text" id="price" name="price" class="form-control" value="<?php echo e(old('price', $catalog->price));?>" moco-validation /> <div class="moco-error-small danger-darker-hover" id="priceError"></div> </div> </div> <!-- Year --> <div class="col-2"> <div class="form-group"> <label for="year"><?php echo e(__('Year'));?></label> <input type="number" id="year" name="year" class="form-control" value="<?php echo e(old('year', $catalog->year));?>" readonly="readonly" moco-validation /> <div class="moco-error-small danger-darker-hover" id="yearError"></div> </div> </div> </div> <div class="row"> <div class="col-10"> <!-- Provider --> <div class="form-group"> <label for="provider"><?php echo e(__('Provider'));?> <a href="#" id="add_provider"><i class="fas fa-plus-square green-darker-hover"></i></a></label> </label> <?php if($partmetadata->id!= null):?> <input type="text" id="provider" name="provider" class="form-control mt-2" value="<?php echo e(\App\Models\Provider::find($catalog->provider_id)->name);?>" readonly="readonly" moco-validation /> <?php else:?> <select id="provider" name="provider" class="selectpicker form-control" <?php if($partmetadata->id!= null):?> disabled <?php endif;?> data-live-search="true" title="<?php echo e(__('Select a provider'));?>" moco-validation> <?php $__currentLoopData = $_providers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $_provider): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop();?> <option value="<?php echo e($_provider->id);?>" <?php if($_provider->id == old('provider', $catalog->provider_id)):?> selected <?php endif;?>><?php echo e($_provider->name);?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop();?> </select> <?php endif;?> <div class="moco-error-small danger-darker-hover" id="providerError"></div> </div> </div> <div class="col-2"> <!-- Enabled --> <div class="form-group"> <label for="enabled"><?php echo e(__('Enabled'));?></label> <select id="enabled" name="enabled" class="selectpicker form-control" data-width="fit" moco-validation> <option value="1" <?php if(old('enabled',$partmetadata->enabled) == 1):?> selected <?php endif;?>><?php echo e(__('Yes'));?></option> <option value="0" <?php if(old('enabled',$partmetadata->enabled) == 0):?> selected <?php endif;?>><?php echo e(__('No'));?></option> </select> <div class="moco-error-small danger-darker-hover" id="enabledError"></div> </div> </div> </div> <div class="d-flex justify-content-between"> <div> <button type="submit" class="btn btn-primary"><?php echo e(__('Save'));?></button> </div> <div> <a href="<?php echo e(route('store.index'));?>" class="btn btn-primary"><?php echo e(__('Cancel'));?></a> </div> </div> </form> </div> </div> </div> <!-- Modal message--> <div class="modal" id="modal_msg" data-backdrop="static" data-keyboard="false"> <div class="modal-dialog modal-dialog-centered modal-lg"> <div class="modal-content"> <div class="modal-header"> <div class="container-fluid"> <div class="d-flex justify-content-sm-center"> <p class="moco-color-info h4"> <?php echo e(__('Enter new provider'));?></p> </div> </div> </div> <div class="modal-body"> <input type="text" id="new_provider" class="form-control"/> </div> <div class="modal-footer"> <div class="container-fluid"> <div class="d-flex justify-content-md-between"> <div><button type="button" class="btn btn-primary" data-dismiss="modal" id="validate"><?php echo e(__('Validate'));?></button></div> <div><button type="button" class="btn btn-primary" data-dismiss="modal"><?php echo e(__('Cancel'));?></button></div> </div> </div> </div> </div> </div> </div> <script type="text/javascript" src="<?php echo e(asset('js/moco.ajax.validation.js'));?>"></script> <script type="text/javascript"> $(function (){ var previousVal = ''; $('#part_number').on('keyup',function () { if($('#bar_code').val() == previousVal){ previousVal = $('#part_number').val(); $('#bar_code').val(previousVal); } }) $('#part-form').on('keypress', function (event) { var keyPressed = event.keyCode || event.which; if (keyPressed === 13) { event.preventDefault(); return false; } }) /** ouvre la fenetre modal pour ajouter un fournisseur **/ $('#add_provider').on('click',() => { $('#modal_msg').modal('show'); }); /** action sur la validation du nouveau fournisseur **/ $('#validate').on('click', () => { let value = $('#new_provider').val(); if (value!= ''){ /** on supprime la selection **/ $('#provider').selectpicker('deselectAll'); /** on retire le précédent nouveau fournisseur s'il existe **/ $('#provider').find('[value=0]').remove(); /** on crée une option avec le nom du nouveau fournisseur **/ $('#provider').append('<option value="0">'+value+'</option>'); /** on le selectionne **/ $('#provider').val(0); /** on rafraichi le layout du select **/ $('#provider').selectpicker('refresh'); /** on charge le champ caché avec le nouveau nom du founisseur **/ $('#new_provider_name').val(value); } }); }) </script> <?php $__env->stopSection();?> <?php echo $__env->make('layouts.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render();?><?php /**PATH /var/www/moco/fassicms/resources/views/store/store-part-form.blade.php ENDPATH**/?> ======================= File: storage/framework/views/6588ccaf56e86096df6ccee89a87beb9aee93567.php ======================= <reponame>smoers/fassicms<gh_stars>0 <?php if($tableHeaderEnabled):?> <thead class="<?php echo e($this->getOption('bootstrap.classes.thead'));?>"> <?php echo $__env->make('laravel-livewire-tables::'.config('laravel-livewire-tables.theme').'.includes.columns', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render();?> </thead> <?php endif;?> <?php /**PATH /var/www/Moco/fassicms/vendor/rappasoft/laravel-livewire-tables/src/../resources/views/bootstrap-4/includes/thead.blade.php ENDPATH**/?> ======================= File: resources/views/store/store-part-form.blade.php ======================= @extends('layouts.layout') @section('content') <div class="container p-5 h-100 moco-layout-height"> <div class="card"> <div class="card-header text-center font-weight-bold"> <h2 class="blue-grey-darker-hover">{{ $title }}</h2> </div> <div class="card-body"> <form name="part-form" id="part-form" method="post" action="{{$_action}}" moco-validation> @csrf <input type="hidden" id="id" name="id" value="{{ $partmetadata->id }}"> <input type="hidden" id="cat_id" name="cat_id" value="{{ $catalog->id }}"> <input type="hidden" id="new_provider_name" name="new_provider_name" value="{{old('new_provider_name')}}"> <div class="row"> <div class="col-6"> <!-- Part Number--> <div class="form-group"> <label for="part_number">{{ __('Part Number') }}</label> <input type="text" id="part_number" name="part_number" class="form-control" @if($partmetadata->id!= null) readonly @endif value="{{ old('part_number', $partmetadata->part_number) }}" moco-validation> <div class="moco-error-small danger-darker-hover" id="part_numberError"></div> </div> </div> <div class="col-6"> <!-- Bar Code--> <div class="form-group"> <label for="part_number">{{ __('Bar Code') }}</label> <input type="text" id="bar_code" name="bar_code" class="form-control" value="{{ old('bar_code', $partmetadata->bar_code) }}" moco-validation> <div class="moco-error-small danger-darker-hover" id="bar_codeError"></div> </div> </div> </div> <div class="row"> <div class="col-10"> <!-- Description --> <div class="form-group"> <label for="description">{{ __('Description') }}</label> <input type="text" id="description" name="description" class="form-control" value="{{old('description', $partmetadata->description)}}" moco-validation /> <div class="moco-error-small danger-darker-hover" id="descriptionError"></div> </div> </div> <div class="col-2"> <!-- Electrical Part --> <div class="d-flex flex-column"> <div>{{ __('Electrical Part') }}</div> <div> <select id="electrical_part" name="electrical_part" class="selectpicker form-control" data-width="fit" title="{{__('Electrical')}}" moco-validation> <option value="1" @if(old('electrical_part',$partmetadata->electrical_part) == 1) selected @endif>{{__('Yes')}}</option> <option value="0" @if(old('electrical_part',$partmetadata->electrical_part) == 0) selected @endif>{{__('No')}}</option> </select> <div class="moco-error-small danger-darker-hover" id="electrical_partError"></div> </div> </div> </div> </div> <!-- Sur une ligne--> <div class="row"> <!-- Reassort Level --> <div class="col-2"> <div class="form-group"> <label for="reassort_level">{{ __('Reassort Level') }}</label> <input type="number" id="reassort_level" name="reassort_level" class="form-control" value="{{old('reassort_level', $partmetadata->reassort_level)}}" moco-validation /> <div class="moco-error-small danger-darker-hover" id="reassort_levelError"></div> </div> </div> @if($partmetadata->id == null) <!-- Quantity --> <div class="col-2"> <div class="form-group"> <label for="qty">{{ __('Quantity') }}</label> <input type="number" id="qty" name="qty" class="form-control" value="{{old('qty', $store->qty)}}" moco-validation/> <div class="moco-error-small danger-darker-hover" id="qtyError"></div> </div> </div> <!-- Location --> <div class="col-4"> <div class="d-flex flex-column"> <div>{{ __('Location') }}</div> <div> <select id="location_id" name="location_id" class="selectpicker form-control" data-width="fit" title="{{__('Select a Location')}}" moco-validation> @foreach(App\Models\Location::all() as $location) <option value="{{$location->id}}" @if(old('location_id',$store->location_id) == $location->id) selected @endif>{{__($location->location)." : ".__($location->description)}}</option> @endforeach </select> <div class="moco-error-small danger-darker-hover" id="location_idError"></div> </div> </div> </div> @endif <!-- Price --> <div class="col-2"> <div class="form-group"> <label for="price">{{ __('Price') }}</label> <input type="text" id="price" name="price" class="form-control" value="{{old('price', $catalog->price)}}" moco-validation /> <div class="moco-error-small danger-darker-hover" id="priceError"></div> </div> </div> <!-- Year --> <div class="col-2"> <div class="form-group"> <label for="year">{{ __('Year') }}</label> <input type="number" id="year" name="year" class="form-control" value="{{ old('year', $catalog->year) }}" readonly="readonly" moco-validation /> <div class="moco-error-small danger-darker-hover" id="yearError"></div> </div> </div> </div> <div class="row"> <div class="col-10"> <!-- Provider --> <div class="form-group"> <label for="provider">{{ __('Provider') }} <a href="#" id="add_provider"><i class="fas fa-plus-square green-darker-hover"></i></a></label> </label> @if($partmetadata->id!= null) <input type="text" id="provider" name="provider" class="form-control mt-2" value="{{ \App\Models\Provider::find($catalog->provider_id)->name }}" readonly="readonly" moco-validation /> @else <select id="provider" name="provider" class="selectpicker form-control" @if($partmetadata->id!= null) disabled @endif data-live-search="true" title="{{__('Select a provider')}}" moco-validation> @foreach($_providers as $_provider) <option value="{{$_provider->id}}" @if($_provider->id == old('provider', $catalog->provider_id)) selected @endif>{{$_provider->name}}</option> @endforeach </select> @endif <div class="moco-error-small danger-darker-hover" id="providerError"></div> </div> </div> <div class="col-2"> <!-- Enabled --> <div class="form-group"> <label for="enabled">{{ __('Enabled') }}</label> <select id="enabled" name="enabled" class="selectpicker form-control" data-width="fit" moco-validation> <option value="1" @if(old('enabled',$partmetadata->enabled) == 1) selected @endif>{{__('Yes')}}</option> <option value="0" @if(old('enabled',$partmetadata->enabled) == 0) selected @endif>{{__('No')}}</option> </select> <div class="moco-error-small danger-darker-hover" id="enabledError"></div> </div> </div> </div> <div class="d-flex justify-content-between"> <div> <button type="submit" class="btn btn-primary">{{__('Save')}}</button> </div> <div> <a href="{{ route('store.index') }}" class="btn btn-primary">{{__('Cancel')}}</a> </div> </div> </form> </div> </div> </div> <!-- Modal message--> <div class="modal" id="modal_msg" data-backdrop="static" data-keyboard="false"> <div class="modal-dialog modal-dialog-centered modal-lg"> <div class="modal-content"> <div class="modal-header"> <div class="container-fluid"> <div class="d-flex justify-content-sm-center"> <p class="moco-color-info h4"> {{__('Enter new provider')}}</p> </div> </div> </div> <div class="modal-body"> <input type="text" id="new_provider" class="form-control"/> </div> <div class="modal-footer"> <div class="container-fluid"> <div class="d-flex justify-content-md-between"> <div><button type="button" class="btn btn-primary" data-dismiss="modal" id="validate">{{__('Validate')}}</button></div> <div><button type="button" class="btn btn-primary" data-dismiss="modal">{{__('Cancel')}}</button></div> </div> </div> </div> </div> </div> </div> <script type="text/javascript" src="{{ asset('js/moco.ajax.validation.js') }}"></script> <script type="text/javascript"> $(function (){ var previousVal = ''; $('#part_number').on('keyup',function () { if($('#bar_code').val() == previousVal){ previousVal = $('#part_number').val(); $('#bar_code').val(previousVal); } }) $('#part-form').on('keypress', function (event) { var keyPressed = event.keyCode || event.which; if (keyPressed === 13) { event.preventDefault(); return false; } }) /** ouvre la fenetre modal pour ajouter un fournisseur **/ $('#add_provider').on('click',() => { $('#modal_msg').modal('show'); }); /** action sur la validation du nouveau fournisseur **/ $('#validate').on('click', () => { let value = $('#new_provider').val(); if (value!= ''){ /** on supprime la selection **/ $('#provider').selectpicker('deselectAll'); /** on retire le précédent nouveau fournisseur s'il existe **/ $('#provider').find('[value=0]').remove(); /** on crée une option avec le nom du nouveau fournisseur **/ $('#provider').append('<option value="0">'+value+'</option>'); /** on le selectionne **/ $('#provider').val(0); /** on rafraichi le layout du select **/ $('#provider').selectpicker('refresh'); /** on charge le champ caché avec le nouveau nom du founisseur **/ $('#new_provider_name').val(value); } }); }) </script> @endsection ======================= File: database/migrations/2020_11_25_182805_add_description_reason_reassortements_table.php ======================= <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class AddDescriptionReasonReassortementsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::disableForeignKeyConstraints(); Schema::table('reassortements', function (Blueprint $table) { $table->string('note',255)->nullable(); $table->unsignedBigInteger('reason_id'); $table->foreign('reason_id') ->references('id') ->on('reasons') ->onUpdate('restrict') ->onDelete('restrict'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('reassortements', function (Blueprint $table) { $table->dropColumn(['note','reason_id']); }); } } ======================= File: storage/framework/views/012bfdb2c8f39f75dee6dbf1b5ccce42ec13c095.php ======================= <filename>storage/framework/views/012bfdb2c8f39f75dee6dbf1b5ccce42ec13c095.php <div class="<?php echo e($this->getOption('bootstrap.container')? 'container-fluid' : '');?>" <?php if(is_numeric($refresh)):?> wire:poll.<?php echo e($refresh);?>.ms <?php elseif(is_string($refresh)):?> wire:poll="<?php echo e($refresh);?>" <?php endif;?> > <?php echo $__env->make('laravel-livewire-tables::'.config('laravel-livewire-tables.theme').'.includes.offline', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render();?> <?php echo $__env->make('laravel-livewire-tables::'.config('laravel-livewire-tables.theme').'.includes.options', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render();?> <?php if($this->getOption('bootstrap.responsive')):?> <div class="table-responsive"> <?php endif;?> <table class="<?php echo e($this->getOption('bootstrap.classes.table'));?>"> <?php echo $__env->make('laravel-livewire-tables::'.config('laravel-livewire-tables.theme').'.includes.thead', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render();?> <?php echo $__env->make('laravel-livewire-tables::'.config('laravel-livewire-tables.theme').'.includes.loading', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render();?> <?php if($models->isEmpty()):?> <?php echo $__env->make('laravel-livewire-tables::'.config('laravel-livewire-tables.theme').'.includes.empty', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render();?> <?php else:?> <?php echo $__env->make('laravel-livewire-tables::'.config('laravel-livewire-tables.theme').'.includes.data', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render();?> <?php endif;?> </tbody> <?php echo $__env->make('laravel-livewire-tables::'.config('laravel-livewire-tables.theme').'.includes.tfoot', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render();?> </table> <?php if($this->getOption('bootstrap.responsive')):?> </div><!--table-responsive--> <?php endif;?> <?php echo $__env->make('laravel-livewire-tables::'.config('laravel-livewire-tables.theme').'.includes.pagination', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render();?> </div> <?php /**PATH /var/www/Moco/fassicms/vendor/rappasoft/laravel-livewire-tables/src/../resources/views/bootstrap-4/table-component.blade.php ENDPATH**/?> ======================= File: app/Exports/CustomerExport.php ======================= <reponame>smoers/fassicms <?php /* * Copyright (c) 2021. MO Consult * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Company : Fassi Belgium * Developer : MO Consult * Author : <NAME> * Date : 21/10/21 17:10 */ /** * Company : Fassi Belgium * Developer : MO Consult * Authority : <NAME> * Date : 21-10-21 */ namespace App\Exports; use App\Moco\Common\Moco; use App\Models\Customer; use Illuminate\Database\Query\Builder; use Maatwebsite\Excel\Concerns\Exportable; use Maatwebsite\Excel\Concerns\FromQuery; use Maatwebsite\Excel\Concerns\ShouldAutoSize; use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithStyles; use Maatwebsite\Excel\Concerns\WithTitle; use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet; class CustomerExport implements FromQuery, WithHeadings, ShouldAutoSize, WithStyles, WithTitle { use Exportable; private $id; /** * @param $id */ public function __construct($id) { $this->id = $id; } /** * @return \Illuminate\Database\Eloquent\Builder|Builder */ public function query() { return Customer::query()->whereKey($this->id); } public function headings(): array { return Moco::translateArrayValue(config('moco.consult.fields.customers.name')); } public function styles(Worksheet $sheet) { return [ 1 => ['font' => ['bold' => true, 'italic' => true]], ]; } public function title(): string { return trans('Customer'); } } ======================= File: app/Http/Controllers/CustomerController.php ======================= <?php namespace App\Http\Controllers; use App\Http\Requests\CustomerRequest; use App\Moco\Common\MocoAjaxValidation; use App\Moco\Common\MocoModelForConsult; use App\Models\Customer; use App\Models\CustomerContact; use App\Models\Zipcode; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use phpDocumentor\Reflection\Types\Array_; class CustomerController extends Controller { use MocoAjaxValidation; /** * CustomerController constructor. */ public function __construct() { //nécessaire pour le trait de validation $this->formRequest = new CustomerRequest(); } public function index(){ return view('customer.customer-list'); } /** * Chargement du formulaire permettant la création d'un nouveau client * * @return \Illuminate\Contracts\View\View */ public function create() { $customer = new Customer(); $customer->black_listed = 0; return view('customer.customer-form', [ 'action' => route('customer.store'), 'customer' => $customer, 'title' => trans('Add customer'), ]); } /** * Chargement du formulaire permettant la modification d'un client existant * * @param $id * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View */ public function edit($id) { return view('customer.customer-form', [ 'action' => route('customer.update', $id), 'customer' => $customer = Customer::find($id), 'title' => trans('Modify customer'), '_zipcode' => Zipcode::where('zipcode','=',$customer->zipcode)->first(), ] ); } /** * Mise à jour de l'enregistrement * * @param CustomerRequest $request * @param $id * @return \Illuminate\Http\RedirectResponse */ public function update(CustomerRequest $request, $id) { /** * Obtenir les valeurs validées */ $validatedData = $request->validated(); /** * Sauvegarde les modifications de l'objet Customer */ $customer = Customer::find($id); $customer->fill($validatedData); $customer->user()->associate(Auth::user()); $contacts = $validatedData['contacts']; DB::transaction(function () use($customer,$contacts) { $customer->save(); /** * Supprime les contacts qui ne font plus partie de la liste POST */ CustomerContact::remove($contacts,$customer); /** * Sauvegarde les contacts qui sont dans le liste POST */ CustomerContact::hydratedAndSave($contacts,$customer); }); return redirect()->route('customer.index')->with('success',trans('The customer has been modified with success')); } /** * Sauvegarde un nouveau client * * @param CustomerRequest $request * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector */ public function store(CustomerRequest $request) { $validateData = $request->validated(); /** * Liste des contacts à sauvegarder */ $contacts = $validateData['contacts']; /** * Création de l'objet Customer */ $customer = new Customer(); $customer->fill($validateData); $customer->user()->associate(Auth::user()); /** * Sauvegarde */ DB::transaction(function () use($customer,$contacts){ $customer->save(); /** * Sauvegarde les contacts qui sont dans le liste POST */ CustomerContact::hydratedAndSave($contacts,$customer); }); /** * récupère la route par défaut */ $route = route('customer.index'); /** * On controle si la demande d'ajout a été faite depuis le formulaire d'ajout d'une fiche de travail */ if ($request->session()->exists('worksheet_form')){ $worksheet_form = $request->session()->get('worksheet_form'); $worksheet_form['customer_id'] = $customer->id; $worksheet_form['name'] = $customer->name; $worksheet_form['address'] = $customer->address.', '.$customer->zipcode.', '.$customer->city; $worksheet_form['email'] = $customer->mail; $worksheet_form['phone'] = $customer->phone; $worksheet_form['vat'] = $customer->vat; $request->session()->put('worksheet_form',$worksheet_form); $route = $request->session()->get('worksheet_source'); } return redirect($route)->with('success', trans('The new customer has been saved')); } /** * Répond au requête Ajax du select element * @param Request $request * @return \Illuminate\Http\JsonResponse */ public function ajaxSelect(Request $request) { $zipcodes = Zipcode::where('zipcode','like',$request->post('zipcode').'%')->get(); return response()->json($zipcodes); } /** * Permet l'affichage des données en mode consultation * * @param $id * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View|\Illuminate\Http\RedirectResponse */ public function show($id) { $customer = Customer::find($id); if (!is_null($customer)){ $mocoModelForConsult = new MocoModelForConsult($customer,Auth::user()->can('consult customer extended')); return view('consult.consult', [ 'title' => trans('Consult Customer'), 'consult' => $mocoModelForConsult->getBladeLayout(), 'return' => route('customer.index'), ]); } return redirect()->route('customer.index'); } } ======================= File: app/Moco/Printer/MocoSticker.php ======================= <filename>app/Moco/Printer/MocoSticker.php<gh_stars>0 <?php /* * Copyright (c) 2020. MO Consult * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Company : Fassi Belgium * Developer : MO Consult * Author : <NAME> * Date : 16/12/20 11:28 */ /** * Company : Fassi Belgium * Developer : MO Consult * Authority : <NAME> * Date : 16-12-20 */ namespace App\Moco\Printer; class MocoSticker { use MocoCustomPageFormat; protected $header = null; protected $part_number = null; protected $bar_code = null; protected $stickerModel; protected $pdf; /** * Sticker constructor. * @param array $stickerModel */ public function __construct(MocoStickerModel $stickerModel) { $this->stickerModel = $stickerModel; $this->setCustomPageFormat($stickerModel); /** * Default */ $this->pdf = new \TCPDF(); $this->pdf->setCreator('Fassi Belgium'); $this->pdf->SetAuthor('MO Consult'); $this->pdf->setTitle('Fiche de travail'); $this->pdf->setPageUnit('mm'); $this->pdf->setMargins(0,0); $this->pdf->setPrintHeader(false); } /** * @param null $header */ public function setStickerHeader($header): void { $this->header = $header; } /** * @param null $part_number */ public function setStickerPartNumber($part_number): void { $this->part_number = $part_number; } /** * @param null $bar_code */ public function setStickerBarCode($bar_code): void { $this->bar_code = $bar_code; } public function generate() { $this->pdf->setAutoPageBreak(true); $this->pdf->setFont('helvetica','',8); $this->pdf->addPage('L',$this->getCustomPageFormat()); $style = array( 'position' => 'C', 'align' => 'C', 'stretch' => true, 'fitwidth' => true, 'cellfitalign' => '', 'border' => false, // border 'hpadding' => 'auto', 'vpadding' => 'auto', 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, //array(255,255,255), 'text' => true, // whether to display the text below the barcode 'font' => 'helvetica', //font 'fontsize' => 6, //font size 'stretchtext' => 6, 'label' => $this->bar_code, ); $this->pdf->text($this->stickerModel->hex,$this->stickerModel->hey,$this->header); $this->pdf->ln(); $this->pdf->setFont('helvetica','B',12); $this->pdf->MultiCell( $this->stickerModel->pnw,$this->stickerModel->pnh,$this->part_number,0,'C',false,1,$this->stickerModel->pnx,$this->stickerModel->pny); $this->pdf->write1DBarcode($this->bar_code, 'C39E', $this->stickerModel->bcx, $this->stickerModel->bcy, $this->stickerModel->bcw, $this->stickerModel->bch, $this->stickerModel->xres, $style, 'N'); } public function Output() { $this->pdf->Output('test.pdf'); } } ======================= File: storage/framework/views/30285ec8684b360b574906dc96e69ca8d39d5c0d.php ======================= <?php if($loadingIndicator):?> <tbody wire:loading.class.remove="d-none" class="d-none"> <tr> <td colspan="<?php echo e(collect($columns)->count());?>"> <?php echo app('translator')->get('laravel-livewire-tables::strings.loading');?> </td> </tr> </tbody> <tbody <?php if($collapseDataOnLoading):?> wire:loading.remove <?php endif;?>> <?php else:?> <tbody> <?php endif;?> <?php /**PATH /var/www/Moco/fassicms/vendor/rappasoft/laravel-livewire-tables/src/../resources/views/bootstrap-4/includes/loading.blade.php ENDPATH**/?> ======================= File: storage/framework/views/9478e79a334db9a48dc152e4b32b216814ba6781.php ======================= <tr> <?php $__currentLoopData = $columns; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $column): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop();?> <?php if($column->isVisible()):?> <?php if($column->isSortable()):?> <th class="<?php echo e($this->setTableHeadClass($column->getAttribute()));?>" id="<?php echo e($this->setTableHeadId($column->getAttribute()));?>" <?php $__currentLoopData = $this->setTableHeadAttributes($column->getAttribute()); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop();?> <?php echo e($key);?>="<?php echo e($value);?>" <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop();?> wire:click="sort('<?php echo e($column->getAttribute());?>')" style="cursor:pointer;" > <?php echo e($column->getText());?> <?php if($sortField!== $column->getAttribute()):?> <?php echo e(new \Illuminate\Support\HtmlString($sortDefaultIcon));?> <?php elseif($sortDirection === 'asc'):?> <?php echo e(new \Illuminate\Support\HtmlString($ascSortIcon));?> <?php else:?> <?php echo e(new \Illuminate\Support\HtmlString($descSortIcon));?> <?php endif;?> </th> <?php else:?> <th class="<?php echo e($this->setTableHeadClass($column->getAttribute()));?>" id="<?php echo e($this->setTableHeadId($column->getAttribute()));?>" <?php $__currentLoopData = $this->setTableHeadAttributes($column->getAttribute()); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop();?> <?php echo e($key);?>="<?php echo e($value);?>" <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop();?> > <?php echo e($column->getText());?> </th> <?php endif;?> <?php endif;?> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop();?> </tr> <?php /**PATH /var/www/Moco/fassicms/vendor/rappasoft/laravel-livewire-tables/src/../resources/views/bootstrap-4/includes/columns.blade.php ENDPATH**/?> ======================= File: app/Http/Livewire/Worksheet/WorksheetList.php ======================= <reponame>smoers/fassicms <?php /* * Copyright (c) 2021. MO Consult * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Company : Fassi Belgium * Developer : MO Consult * Author : <NAME> * Date : 4/01/21 17:56 */ namespace App\Http\Livewire\Worksheet; use App\Models\ViewWorksheetCustomerCrane; use Carbon\Carbon; use Illuminate\Database\Eloquent\Builder; use Rappasoft\LaravelLivewireTables\TableComponent; use Rappasoft\LaravelLivewireTables\Traits\HtmlComponents; use Rappasoft\LaravelLivewireTables\Views\Column; class WorksheetList extends TableComponent { use HtmlComponents; protected $rowClass =''; public $year = null; public $template = false; public $validate = false; protected $listeners = ['headerChange']; /** * Configuration par défaut */ public function mount() { $this->year = Carbon::now()->year; $this->template = false; } /** * CraneList constructor. * @param null $id */ public function __construct($id = null) { $this->perPage = config('moco.table.perPage'); $this->perPageOptions = config('moco.table.perPageOptions'); $this->rowClass = config('moco.table.rowClass'); $this->loadingIndicator =true; $this->sortField = 'number'; $this->sortDefaultIcon = '<i class="fas fa-sort-alpha-down"></i>'; $this->ascSortIcon = '<i class="fas fa-sort-alpha-up"></i>'; $this->descSortIcon = '<i class="fas fa-sort-alpha-down"></i>'; parent::__construct($id); } /** * @return Builder */ public function query(): Builder { $year = $this->template? null : $this->year; $builder = ViewWorksheetCustomerCrane::select()->where('year','=',$year); if ($this->validate) $builder = $builder->where('validated','=',true); return $builder; } /** * @return array */ public function columns(): array { return [ Column::make(trans('Number'),'number') ->searchable() ->sortable(), Column::make(trans('Date'), 'date') ->searchable() ->sortable() ->format(function (ViewWorksheetCustomerCrane $model){ return!is_null($model->date)? Carbon::createFromFormat('d/m/Y', $model->date)->format('d/m/Y') : ''; }), Column::make(trans('Customer name'),'name') ->searchable() ->sortable(), Column::make(trans('Crane serial'),'serial') ->searchable() ->sortable(), Column::make(trans('Warranty'),'warranty') ->searchable() ->sortable() ->format(function (ViewWorksheetCustomerCrane $model){ return $model->warranty == 1? trans('Yes') : trans('No');}), Column::make(trans('Actions'),'actions') ->format(function (ViewWorksheetCustomerCrane $model){ return view('menus.list-submenu',['whatIs' => 'worksheet', 'worksheet' => $model]); }), ]; } /** * @param $attribute * @return string|null */ public function setTableHeadClass($attribute):?string { $extend =''; switch ($attribute) { case 'actions': $extend.= 'moco-size-column-table-400'; break; case 'date': case 'number': $extend.='moco-size-column-table-150'; break; case 'warranty': $extend.='moco-size-column-table-100'; break; } return'moco-title-table'.$extend; } /** * @param $attribute * @param $value * @return string|null */ public function setTableDataClass($attribute, $value):?string { return $this->rowClass; } /** * Highlight la ligne si la fiche de travail est validée * * @param $model * @return string|null */ public function setTableRowClass($model):?string { return $model->validated?'moco-row-highlight-table':''; } /** * Event déclenché par une modification dans le header * * @param $year * @param $template */ public function headerChange($year,$template,$validate) { $this->year = $year; $this->template = $template; $this->validate = $validate; } } ======================= File: app/Http/Requests/CustomerRequest.php ======================= <filename>app/Http/Requests/CustomerRequest.php <?php namespace App\Http\Requests; use Illuminate\Foundation\Http\FormRequest; class CustomerRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ 'name' =>'required|max:100|unique:customers,name,'.$this->post('id'), 'address' =>'required|max:100', 'address_optional' =>'max:100', 'city' =>'required|max:50', 'zipcode' =>'required|max:10', 'country' =>'required|max:100', 'mail' => 'nullable|email|max:100', 'phone' =>'max:100', 'mobile' =>'max:100', 'vat' =>'max:15', 'black_listed' =>'required', 'contacts.id.*' => 'nullable', 'contacts.firstname.*' => 'nullable|max:255', 'contacts.lastname.*' =>'required|max:255', 'contacts.function.*' => 'nullable|max:255', 'contacts.phone.*' => 'nullable|max:100', 'contacts.mobile.*' => 'nullable|max:100', ]; } public function messages() { return [ 'required' => trans('The field :attribute is required'), 'size' => trans('The maximum size for :attribue is :max') ]; } public function attributes() { return [ 'name' => trans('Company name'), 'address' => trans('Address'), 'address_optional' => trans('Address (optional)'), 'city' => trans('City'), 'zipcode' => trans('Zipcode'), 'country' => trans('Country'), 'mail' => ('Email address'), 'phone' => ('Phone number'), 'mobile' => ('Mobile number'), 'vat' => trans('VAT'), 'black_listed' => trans('Black listed'), 'contacts.firstname.*' => trans('Contact firstname'), 'contacts.lastname.*' => trans('Contact lastname'), 'contacts.function.*' => trans('Contact function'), 'contacts.phone.*' => trans('Contact phone number'), 'contacts.mobile.*' => trans('Contact mobile number'), ]; } } ======================= File: storage/framework/views/8e6a5dfaf5e73e0e4dc8506a4109cc250005af85.php ======================= <?php $__currentLoopData = $models; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $model): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop();?> <tr class="<?php echo e($this->setTableRowClass($model));?>" id="<?php echo e($this->setTableRowId($model));?>" <?php $__currentLoopData = $this->setTableRowAttributes($model); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop();?> <?php echo e($key);?>="<?php echo e($value);?>" <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop();?> <?php if($this->getTableRowUrl($model)):?> onclick="window.location='<?php echo e($this->getTableRowUrl($model));?>';" style="cursor:pointer" <?php endif;?> > <?php $__currentLoopData = $columns; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $column): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop();?> <?php if($column->isVisible()):?> <td class="<?php echo e($this->setTableDataClass($column->getAttribute(), data_get($model, $column->getAttribute())));?>" id="<?php echo e($this->setTableDataId($column->getAttribute(), data_get($model, $column->getAttribute())));?>" <?php $__currentLoopData = $this->setTableDataAttributes($column->getAttribute(), data_get($model, $column->getAttribute())); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop();?> <?php echo e($key);?>="<?php echo e($value);?>" <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop();?> > <?php if($column->isFormatted()):?> <?php if($column->isRaw()):?> <?php echo $column->formatted($model, $column);?> <?php else:?> <?php echo e($column->formatted($model, $column));?> <?php endif;?> <?php else:?> <?php if($column->isRaw()):?> <?php echo data_get($model, $column->getAttribute());?> <?php else:?> <?php echo e(data_get($model, $column->getAttribute()));?> <?php endif;?> <?php endif;?> </td> <?php endif;?> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop();?> </tr> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop();?> <?php /**PATH /var/www/Moco/fassicms/vendor/rappasoft/laravel-livewire-tables/src/../resources/views/bootstrap-4/includes/data.blade.php ENDPATH**/?> ======================= File: storage/framework/views/be997bd38d4f24aab0e5ee7bee2101a3b09efaa6.php ======================= <filename>storage/framework/views/be997bd38d4f24aab0e5ee7bee2101a3b09efaa6.php <div> <input wire:model="message"> <p><?php echo e($message);?></p> </div> <?php /**PATH /var/www/Moco/fassicms/resources/views/livewire/counter.blade.php ENDPATH**/?> ======================= File: app/Models/Out.php ======================= <?php /* * Copyright (c) 2020. MO Consult * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Company : Fassi Belgium * Developer : MO Consult * Authority : <NAME> * Date : 08-11-20 */ namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Out extends Model { use HasFactory; /** * Retourne l'objet Store lié à l'objet Out * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function store() { return $this->belongsTo(Store::class); } /** * Retourne l'objet Reason lié à l'objet Out * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function reason() { return $this->belongsTo(Reason::class); } /** * Retourne l'objet User lié à l'objet Out * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function user() { return $this->belongsTo(User::class); } /* * Convertir en format MySQL */ public function setQtyPullAttribute($value) { $this->attributes['qty_pull'] = intval($value); } /** * @param $value * @return string|null */ public function getQtyPullAttribute($value) { if($value == ''){ return null; } else { return number_format(intval($value), 0, ',', ''); } } /* * Convertir en format MySQL */ public function setQtyBeforeAttribute($value) { $this->attributes['qty_before'] = intval($value); } /** * @param $value * @return string|null */ public function getQtyBeforeAttribute($value) { if($value == ''){ return null; } else { return number_format(intval($value), 0, ',', ''); } } } ======================= File: storage/framework/views/f51fc67539111363a02ba8fe98de6167d108d1b6.php ======================= <filename>storage/framework/views/f51fc67539111363a02ba8fe98de6167d108d1b6.php <?php $__env->startSection('content');?> <div class="container p-5 h-100 moco-layout-height" style="min-width: 50vw"> <div class="card"> <div class="card-header text-center font-weight-bold"> <h2 class="blue-grey-darker-hover"><?php echo e(__('Parts list'));?></h2> </div> <div class="card-body"> <div class="d-flex justify-content-between mb-3"> <div class="d-flex flex-row"> <div class="mr-2"><?php echo e(_('Date'));?> :</div> <div class="mr-2"><?php echo e($worksheet->date);?></div> </div> <div class="d-flex flex-row"> <div class="mr-2"><?php echo e(_('Number'));?> :</div> <div class="mr-2 moco-color-error"><?php echo e($worksheet->number);?></div> </div> <div class="d-flex flex-row"> <div class="mr-2"><?php echo e(_('Total'));?> :</div> <div class="mr-2 moco-color-error" style="font-weight: bold"><?php echo e(number_format(intval($_total['O'])+intval($_total['R']),2,',','.'));?></div> </div> </div> <ul class="nav nav-tabs nav-fill mb-3" > <li class="nav-item" > <a href="#out" class="nav-link active" data-toggle="tab"><?php echo e(__('Parts Out'));?></a> </li> <li class="nav-item"> <a href="#in" class="nav-link" data-toggle="tab"><?php echo e(__('Parts Return'));?></a> </li> </ul> <div class="tab-content"> <!-- TAB OUT--> <div class="tab-pane fade show active" id="out"> <table class="table table-sm table-striped table-bordered mt-2"> <thead class="moco-title-table"> <tr> <th class="moco-row-table-font-small"><?php echo e(__('Part Number'));?></th> <th class="moco-row-table-font-small"><?php echo e(__('Description'));?></th> <th class="moco-row-table-font-small"><?php echo e(__('Quantity'));?></th> <th class="moco-row-table-font-small"><?php echo e(__('Unit Price'));?></th> <th class="moco-row-table-font-small"><?php echo e(__('Total Price'));?></th> <th class="moco-row-table-font-small"><?php echo e(__('Year'));?></th> <th class="moco-row-table-font-small"><?php echo e(__('Date'));?></th> </tr> </thead> <tbody> <?php $__currentLoopData = $_outs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $_out): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop();?> <tr> <td class="moco-row-table-font-small"><?php echo e($_out->part_number);?></td> <td class="moco-row-table-font-small"><?php echo e($_out->description);?></td> <td class="moco-row-table-font-small text-right"><?php echo e($_out->qty_signed);?></td> <td class="moco-row-table-font-small text-right"><?php echo e($_out->unit_price_signed);?></td> <td class="moco-row-table-font-small text-right"><?php echo e($_out->total_price_signed);?></td> <td class="moco-row-table-font-small text-right"><?php echo e($_out->year);?></td> <td class="moco-row-table-font-small text-right"><?php echo e($_out->updated_at);?></td> </tr> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop();?> <tr> <td colspan="4" class="moco-row-table-font-small text-right moco-color-error" style="font-weight: bold">Total :</td> <td class="moco-row-table-font-small text-right moco-color-error" style="font-weight: bold"><?php echo e(number_format(intval($_total['O']),2,',','.'));?></td> <td colspan="2"></
66,265
thestackv1_concat_by_repo-long/65536-65536
aW5rIGRzIHRvIGEtLT48ZyBpZD0ibGlua19kc19hIj48cGF0aCBkPSJNMTA5NC4zLDYzMi4wNCBDMTA3NC4zLDY0Ny44MSAxMDUwLjA1LDY2My41NyAxMDI1LDY3MiBDOTc4LjEzLDY4Ny43OCAxNzEuMzksNjU3LjAyIDEzNSw2OTAuNSBDMTA2LjQyLDcxNi44IDEwMC44LDc1OS40OCAxMDIuNzMsNzk2LjkxICIgZmlsbD0ibm9uZSIgaWQ9ImRzLXRvLWEiIHN0eWxlPSJzdHJva2U6IzY2NjY2NjtzdHJva2Utd2lkdGg6MS4wOyIvPjxwb2x5Z29uIGZpbGw9IiM2NjY2NjYiIHBvaW50cz0iMTAzLjMsODA1LjMsMTA1Ljc1MDUsNzk3LjExNSw5OS43NjQzLDc5Ny41MjE5LDEwMy4zLDgwNS4zIiBzdHlsZT0ic3Ryb2tlOiM2NjY2NjY7c3Ryb2tlLXdpZHRoOjEuMDsiLz48dGV4dCBmaWxsPSIjNjY2NjY2IiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMiIgZm9udC13ZWlnaHQ9ImJvbGQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iMTAwIiB4PSIxMzYiIHk9IjczMC42Mzg3Ij5TZW5kcyBkYXRhIHRvPC90ZXh0Pjx0ZXh0IGZpbGw9IiM2NjY2NjYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iYm9sZCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSI1MSIgeD0iMTYyLjUiIHk9Ijc0NC42MDc0Ij5hcmNoaXZlPC90ZXh0PjwvZz48IS0tTUQ1PVs2ZTNlMzMwZDViNzM1MmU4ZTk5YTQzNDU2YTkzNGQyZl0KbGluayBhZCB0byBhZHMtLT48ZyBpZD0ibGlua19hZF9hZHMiPjxwYXRoIGQ9Ik0zNzYuNTgsMTkxLjU5IEMzODUuMTcsMjU0LjE4IDQwNi45NCwzNDEuNDUgNDYyLDM5NSBDNDcwLjk3LDQwMy43MyA0NzguODUsMzk1LjY4IDQ4OSw0MDMgQzUzMy4yMSw0MzQuODggNTY3LjI3LDQ4Ny4yNiA1ODguNzYsNTI3LjQxICIgZmlsbD0ibm9uZSIgaWQ9ImFkLXRvLWFkcyIgc3R5bGU9InN0cm9rZTojNjY2NjY2O3N0cm9rZS13aWR0aDoxLjA7Ii8+PHBvbHlnb24gZmlsbD0iIzY2NjY2NiIgcG9pbnRzPSI1OTIuNjMsNTM0Ljc1LDU5MS41NTI0LDUyNi4yNzQyLDU4Ni4yNDUsNTI5LjA3MjcsNTkyLjYzLDUzNC43NSIgc3R5bGU9InN0cm9rZTojNjY2NjY2O3N0cm9rZS13aWR0aDoxLjA7Ii8+PHRleHQgZmlsbD0iIzY2NjY2NiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTIiIGZvbnQtd2VpZ2h0PSJib2xkIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjExOCIgeD0iNDczLjUiIHk9IjI2Ni4xMzg3Ij5Mb2dpbiB0byBkZXZlbG9wPC90ZXh0Pjx0ZXh0IGZpbGw9IiM2NjY2NjYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iYm9sZCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIxMTQiIHg9IjQ3NS41IiB5PSIyODAuMTA3NCI+YWxnb3JpdGhtcywgdGVzdDwvdGV4dD48dGV4dCBmaWxsPSIjNjY2NjY2IiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMiIgZm9udC13ZWlnaHQ9ImJvbGQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iODEiIHg9IjQ5MiIgeT0iMjk0LjA3NjIiPmFsZ29yaXRobXMsPC90ZXh0Pjx0ZXh0IGZpbGw9IiM2NjY2NjYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iYm9sZCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIxMDQiIHg9IjQ4MC41IiB5PSIzMDguMDQ0OSI+b3BlcmF0aW9uYWxpemU8L3RleHQ+PHRleHQgZmlsbD0iIzY2NjY2NiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTIiIGZvbnQtd2VpZ2h0PSJib2xkIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjEzOCIgeD0iNDYzLjUiIHk9IjMyMi4wMTM3Ij53b3JrZmxvd3MsIGV4ZWN1dGU8L3RleHQ+PHRleHQgZmlsbD0iIzY2NjY2NiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTIiIGZvbnQtd2VpZ2h0PSJib2xkIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9Ijg2IiB4PSI0ODkuNSIgeT0iMzM1Ljk4MjQiPmFuZCBtb25pdG9yPC90ZXh0Pjx0ZXh0IGZpbGw9IiM2NjY2NjYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iYm9sZCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSI4MyIgeD0iNDkxIiB5PSIzNDkuOTUxMiI+b3BlcmF0aW9uYWw8L3RleHQ+PHRleHQgZmlsbD0iIzY2NjY2NiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTIiIGZvbnQtd2VpZ2h0PSJib2xkIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjEzOSIgeD0iNDYzIiB5PSIzNjMuOTE5OSI+d29ya2Zsb3dzLCB2YWxpZGF0ZTwvdGV4dD48dGV4dCBmaWxsPSIjNjY2NjY2IiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMiIgZm9udC13ZWlnaHQ9ImJvbGQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iNjMiIHg9IjUwMyIgeT0iMzc3Ljg4ODciPnByb2R1Y3RzPC90ZXh0Pjx0ZXh0IGZpbGw9IiM2NjY2NjYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXN0eWxlPSJpdGFsaWMiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iMjMiIHg9IjUyMyIgeT0iMzkxLjg1NzQiPltVSV08L3RleHQ+PC9nPjwhLS1NRDU9WzM5Njc1YTZmYjQ1ZjA4Y2UxYjVmMGI3Zjg5ZmE0MzVkXQpsaW5rIG9wIHRvIHNwcy0tPjxnIGlkPSJsaW5rX29wX3NwcyI+PHBhdGggZD0iTTEzMTYuNjUsNjQzLjk1IEMxMjk4LjI1LDY1My42MiAxMjc5LjE4LDY2My4zMiAxMjYxLDY3MiBDMTEzOS41Myw3MzAgOTk2LjgzLDc4OC44IDg5OS4zNyw4MjcuNTggIiBmaWxsPSJub25lIiBpZD0ib3AtdG8tc3BzIiBzdHlsZT0ic3Ryb2tlOiM2NjY2NjY7c3Ryb2tlLXdpZHRoOjEuMDsiLz48cG9seWdvbiBmaWxsPSIjNjY2NjY2IiBwb2ludHM9Ijg5MS44NSw4MzAuNTcsOTAwLjM5MjMsODMwLjM5ODUsODk4LjE3MzIsODI0LjgyMzksODkxLjg1LDgzMC41NyIgc3R5bGU9InN0cm9rZTojNjY2NjY2O3N0cm9rZS13aWR0aDoxLjA7Ii8+PHRleHQgZmlsbD0iIzY2NjY2NiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTIiIGZvbnQtd2VpZ2h0PSJib2xkIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjExMiIgeD0iMTIyNi41IiB5PSI3MDIuNjM4NyI+ZW5zdXJlIG9uZ29pbmc8L3RleHQ+PHRleHQgZmlsbD0iIzY2NjY2NiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTIiIGZvbnQtd2VpZ2h0PSJib2xkIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjE0MyIgeD0iMTIxMSIgeT0iNzE2LjYwNzQiPnByb2R1Y3QgZ2VuZXJhdGlvbiw8L3RleHQ+PHRleHQgZmlsbD0iIzY2NjY2NiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTIiIGZvbnQtd2VpZ2h0PSJib2xkIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjE0MiIgeD0iMTIxMS41IiB5PSI3MzAuNTc2MiI+bW9uaXRvciBwcm9jZXNzaW5nLDwvdGV4dD48dGV4dCBmaWxsPSIjNjY2NjY2IiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMiIgZm9udC13ZWlnaHQ9ImJvbGQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iOTgiIHg9IjEyMzMuNSIgeT0iNzQ0LjU0NDkiPnRyaWFnZSBpc3N1ZXMsPC90ZXh0Pjx0ZXh0IGZpbGw9IiM2NjY2NjYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iYm9sZCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIxMDUiIHg9IjEyMzAiIHk9Ijc1OC41MTM3Ij5lbnN1cmUgYXJjaGl2ZTwvdGV4dD48dGV4dCBmaWxsPSIjNjY2NjY2IiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMiIgZm9udC13ZWlnaHQ9ImJvbGQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iNTYiIHg9IjEyNTYuNSIgeT0iNzcyLjQ4MjQiPmRlbGl2ZXJ5PC90ZXh0PjwvZz48IS0tTUQ1PVs3YTJjZjIxNmY2ZmYyZjcxNTlmMzQ1MTZiZTYwMDE5OF0KbGluayBjdiB0byBhZHMtLT48ZyBpZD0ibGlua19jdl9hZHMiPjxwYXRoIGQ9Ik02MTUsMTkxLjUzIEM2MTUsMjg0Ljk4IDYxNSw0NDIuNTQgNjE1LDUyNi42MiAiIGZpbGw9Im5vbmUiIGlkPSJjdi10by1hZHMiIHN0eWxlPSJzdHJva2U6IzY2NjY2NjtzdHJva2Utd2lkdGg6MS4wOyIvPjxwb2x5Z29uIGZpbGw9IiM2NjY2NjYiIHBvaW50cz0iNjE1LDUzNC43Nyw2MTgsNTI2Ljc3LDYxMiw1MjYuNzcsNjE1LDUzNC43NyIgc3R5bGU9InN0cm9rZTojNjY2NjY2O3N0cm9rZS13aWR0aDoxLjA7Ii8+PHRleHQgZmlsbD0iIzY2NjY2NiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTIiIGZvbnQtd2VpZ2h0PSJib2xkIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjE0NSIgeD0iNjE2IiB5PSIzMDEuMTM4NyI+Q2FsaWJyYXRlIGFsZ29yaXRobXM8L3RleHQ+PHRleHQgZmlsbD0iIzY2NjY2NiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTIiIGZvbnQtd2VpZ2h0PSJib2xkIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9Ijg4IiB4PSI2NDQuNSIgeT0iMzE1LjEwNzQiPmFuZCB2YWxpZGF0ZTwvdGV4dD48dGV4dCBmaWxsPSIjNjY2NjY2IiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMiIgZm9udC13ZWlnaHQ9ImJvbGQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iMTEyIiB4PSI2MzIuNSIgeT0iMzI5LjA3NjIiPmdlbmVyYXRlZCBkYXRhPC90ZXh0Pjx0ZXh0IGZpbGw9IiM2NjY2NjYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iYm9sZCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIxMzYiIHg9IjYyMC41IiB5PSIzNDMuMDQ0OSI+dXNpbmcgZXhpc3RpbmcgZGF0YTwvdGV4dD48dGV4dCBmaWxsPSIjNjY2NjY2IiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMiIgZm9udC13ZWlnaHQ9ImJvbGQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iNjMiIHg9IjY1OSIgeT0iMzU3LjAxMzciPnByb2R1Y3RzPC90ZXh0PjwvZz48IS0tTUQ1PVszOTM3ZTRmZGYxZDMzYzI4NGE0M2U4NGFhMTUxNWRiNV0KbGluayBvdSB0byBkYXBhLS0+PGcgaWQ9Imxpbmtfb3VfZGFwYSI+PHBhdGggZD0iTTgyMS44NCwyMjQuMTYgQzgwNi45MiwyNzcuNTQgNzkwLjA4LDM0My4yMiA3NzksNDAzIEM3NzUuMzgyNSw0MjIuNTMgNzcyLjMzNDQsNDQzLjM3ODcgNzY5Ljc5NDQsNDYzLjcxNDUgQzc2OS40NzY5LDQ2Ni4yNTY1IDc2OS4xNjczLDQ2OC43OTA1IDc2OC44NjU2LDQ3MS4zMTI4IEM3NjguNzE0Nyw0NzIuNTc0IDc2OC41NjU4LDQ3My44MzIzIDc2OC40MTg4LDQ3NS4wODcyIEM3NjguMzQ1Myw0NzUuNzE0NyA3NjguMjcyMyw0NzYuMzQxMyA3NjguMTk5OCw0NzYuOTY3MSBDNzY4LjE2MzUsNDc3LjI3OTkgNzY4LjEyNzQsNDc3LjU5MjYgNzY4LjA5MTQsNDc3LjkwNSAiIGZpbGw9Im5vbmUiIGlkPSJvdS10by1kYXBhIiBzdHlsZT0ic3Ryb2tlOiM2NjY2NjY7c3Ryb2tlLXdpZHRoOjEuMDsiLz48cG9seWdvbiBmaWxsPSIjNjY2NjY2IiBwb2ludHM9Ijc2OC4wOTE0LDQ3Ny45MDUsNzcxLjk4NzksNDcwLjMwMTIsNzY2LjAyNzQsNDY5LjYxNDEsNzY4LjA5MTQsNDc3LjkwNSIgc3R5bGU9InN0cm9rZTojNjY2NjY2O3N0cm9rZS13aWR0aDoxLjA7Ii8+PHRleHQgZmlsbD0iIzY2NjY2NiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTIiIGZvbnQtd2VpZ2h0PSJib2xkIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjEzNyIgeD0iODE1IiB5PSIyNzMuMTM4NyI+VXNlcnMgaW50ZXJlc3RlZCBpbjwvdGV4dD48dGV4dCBmaWxsPSIjNjY2NjY2IiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMiIgZm9udC13ZWlnaHQ9ImJvbGQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iMTA5IiB4PSI4MjkiIHk9IjI4Ny4xMDc0Ij5leGFtaW5pbmcgZGF0YTwvdGV4dD48dGV4dCBmaWxsPSIjNjY2NjY2IiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMiIgZm9udC13ZWlnaHQ9ImJvbGQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iMTQwIiB4PSI4MTMuNSIgeT0iMzAxLjA3NjIiPnByb2R1Y3RzLCBhbGdvcml0aG08L3RleHQ+PHRleHQgZmlsbD0iIzY2NjY2NiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTIiIGZvbnQtd2VpZ2h0PSJib2xkIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjE0NyIgeD0iODEyIiB5PSIzMTUuMDQ0OSI+cHJvdG90eXBlcywgb3IgJ29wZW48L3RleHQ+PHRleHQgZmlsbD0iIzY2NjY2NiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTIiIGZvbnQtd2VpZ2h0PSJib2xkIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9Ijk2IiB4PSI4MzUuNSIgeT0iMzI5LjAxMzciPnNjaWVuY2UnIHN0eWxlPC90ZXh0Pjx0ZXh0IGZpbGw9IiM2NjY2NjYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iYm9sZCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIxMTkiIHg9IjgyNCIgeT0iMzQyLjk4MjQiPmludmVzdGlnYXRpb25zIG9mPC90ZXh0Pjx0ZXh0IGZpbGw9IiM2NjY2NjYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iYm9sZCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIxMzgiIHg9IjgxMi41IiB5PSIzNTYuOTUxMiI+cHJvZHVjdCBnZW5lcmF0aW9uPC90ZXh0Pjx0ZXh0IGZpbGw9IiM2NjY2NjYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iYm9sZCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIxMzYiIHg9IjgxNS41IiB5PSIzNzAuOTE5OSI+KHJlcHJvZHVjZSwgcmUtcnVuLDwvdGV4dD48dGV4dCBmaWxsPSIjNjY2NjY2IiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMiIgZm9udC13ZWlnaHQ9ImJvbGQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iNjQiIHg9Ijg1My41IiB5PSIzODQuODg4NyI+ZXhhbWluZSk8L3RleHQ+PC9nPjwhLS1NRDU9WzNhZTQzMDVjNmYxMWQ1YjA5NzE1YmIyZjEyM2JlMGE4XQpsaW5rIGRhcGEgdG8gc3BzLS0+PGcgaWQ9ImxpbmtfZGFwYV9zcHMiPjxwYXRoIGQ9Ik03NjUuMjExMiw2NTYuODAxIEM3NjUuMjcyMyw2NTcuNTAyMyA3NjUuMzMzNyw2NTguMjA2NyA3NjUuMzk1Myw2NTguOTE0MSBDNzY1LjUxODYsNjYwLjMyODkgNzY1LjY0MjksNjYxLjc1NTcgNzY1Ljc2ODIsNjYzLjE5MzkgQzc2Ni4wMTg4LDY2Ni4wNzAxIDc2Ni4yNzM0LDY2OC45OTEzIDc2Ni41MzEzLDY3MS45NTEzIEM3NzAuNjU3NSw3MTkuMzEgNzc1LjY0NSw3NzYuNTcgNzc5LjIzLDgxNy43NiAiIGZpbGw9Im5vbmUiIGlkPSJkYXBhLXRvLXNwcyIgc3R5bGU9InN0cm9rZTojNjY2NjY2O3N0cm9rZS13aWR0aDoxLjA7Ii8+PHBvbHlnb24gZmlsbD0iIzY2NjY2NiIgcG9pbnRzPSI3NzkuOTMsODI1Ljc3LDc4Mi4yMzIxLDgxNy41NDIsNzc2LjI1NDIsODE4LjA1NzEsNzc5LjkzLDgyNS43NyIgc3R5bGU9InN0cm9rZTojNjY2NjY2O3N0cm9rZS13aWR0aDoxLjA7Ii8+PHRleHQgZmlsbD0iIzY2NjY2NiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTIiIGZvbnQtd2VpZ2h0PSJib2xkIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjExNyIgeD0iNzg0IiB5PSI3MTYuNjM4NyI+UHJvdmlkZXMgZGF0YSB0bzwvdGV4dD48dGV4dCBmaWxsPSIjNjY2NjY2IiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMiIgZm9udC13ZWlnaHQ9ImJvbGQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iMTMzIiB4PSI3NzYiIHk9IjczMC42MDc0Ij5wcm9jZXNzaW5nIHN5c3RlbTwvdGV4dD48dGV4dCBmaWxsPSIjNjY2NjY2IiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMiIgZm9udC13ZWlnaHQ9ImJvbGQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iOTIiIHg9Ijc5Ni41IiB5PSI3NDQuNTc2MiI+YW5kIGNhdGFsb2dzPC90ZXh0Pjx0ZXh0IGZpbGw9IiM2NjY2NjYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iYm9sZCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIxMzIiIHg9Ijc3OC41IiB5PSI3NTguNTQ0OSI+cHJvY2Vzc2luZyByZXN1bHRzPC90ZXh0PjwvZz48cmVjdCBoZWlnaHQ9IjEzMC4wNzgxIiByeD0iNy41IiByeT0iNy41IiBzdHlsZT0ic3Ryb2tlOiMwMDAwMDAwMDtzdHJva2Utd2lkdGg6MS4wO2ZpbGw6bm9uZTsiIHdpZHRoPSIxNDQiIHg9IjEzNjciIHk9Ijk1NC45MDYzIi8+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGZvbnQtd2VpZ2h0PSJib2xkIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjU5IiB4PSIxMzczIiB5PSI5NzUuOTAxNCI+TGVnZW5kPC90ZXh0Pjx0ZXh0IGZpbGw9IiNGRkZGRkYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjQiIHg9IjE0MzIiIHk9Ijk3NS45MDE0Ij7CoDwvdGV4dD48cmVjdCBmaWxsPSIjMDg0MjdCIiBoZWlnaHQ9IjE2LjI5NjkiIHN0eWxlPSJzdHJva2U6bm9uZTtzdHJva2Utd2lkdGg6MS4wOyIgd2lkdGg9IjEzMiIgeD0iMTM3MyIgeT0iOTc5LjIwMzEiLz48dGV4dCBmaWxsPSIjRkZGRkZGIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSI0OSIgeD0iMTM3NyIgeT0iOTkyLjE5ODIiPnBlcnNvbjwvdGV4dD48cmVjdCBmaWxsPSIjMTE2OEJEIiBoZWlnaHQ9IjE2LjI5NjkiIHN0eWxlPSJzdHJva2U6bm9uZTtzdHJva2Utd2lkdGg6MS4wOyIgd2lkdGg9IjEzMiIgeD0iMTM3MyIgeT0iOTk1LjUiLz48dGV4dCBmaWxsPSIjRkZGRkZGIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSI1MCIgeD0iMTM3NyIgeT0iMTAwOC40OTUxIj5zeXN0ZW08L3RleHQ+PHJlY3QgZmlsbD0iIzQzOERENSIgaGVpZ2h0PSIxNi4yOTY5IiBzdHlsZT0ic3Ryb2tlOm5vbmU7c3Ryb2tlLXdpZHRoOjEuMDsiIHdpZHRoPSIxMzIiIHg9IjEzNzMiIHk9IjEwMTEuNzk2OSIvPjx0ZXh0IGZpbGw9IiNGRkZGRkYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjY1IiB4PSIxMzc3IiB5PSIxMDI0Ljc5MiI+Y29udGFpbmVyPC90ZXh0PjxyZWN0IGZpbGw9IiM2ODY4NjgiIGhlaWdodD0iMTYuMjk2OSIgc3R5bGU9InN0cm9rZTpub25lO3N0cm9rZS13aWR0aDoxLjA7IiB3aWR0aD0iMTMyIiB4PSIxMzczIiB5PSIxMDI4LjA5MzgiLz48dGV4dCBmaWxsPSIjRkZGRkZGIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIxMDgiIHg9IjEzNzciIHk9IjEwNDEuMDg4OSI+ZXh0ZXJuYWwgcGVyc29uPC90ZXh0PjxyZWN0IGZpbGw9IiM5OTk5OTkiIGhlaWdodD0iMTYuMjk2OSIgc3R5bGU9InN0cm9rZTpub25lO3N0cm9rZS13aWR0aDoxLjA7IiB3aWR0aD0iMTMyIiB4PSIxMzczIiB5PSIxMDQ0LjM5MDYiLz48dGV4dCBmaWxsPSIjRkZGRkZGIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIxMDkiIHg9IjEzNzciIHk9IjEwNTcuMzg1NyI+ZXh0ZXJuYWwgc3lzdGVtPC90ZXh0PjxyZWN0IGZpbGw9IiNCM0IzQjMiIGhlaWdodD0iMTYuMjk2OSIgc3R5bGU9InN0cm9rZTpub25lO3N0cm9rZS13aWR0aDoxLjA7IiB3aWR0aD0iMTMyIiB4PSIxMzczIiB5PSIxMDYwLjY4NzUiLz48dGV4dCBmaWxsPSIjRkZGRkZGIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIxMjQiIHg9IjEzNzciIHk9IjEwNzMuNjgyNiI+ZXh0ZXJuYWwgY29udGFpbmVyPC90ZXh0PjxsaW5lIHN0eWxlPSJzdHJva2U6I0ZGRkZGRjtzdHJva2Utd2lkdGg6MS4wOyIgeDE9IjEzNzMiIHgyPSIxNTA1IiB5MT0iOTYyLjkwNjMiIHkyPSI5NjIuOTA2MyIvPjxsaW5lIHN0eWxlPSJzdHJva2U6I0ZGRkZGRjtzdHJva2Utd2lkdGg6MS4wOyIgeDE9IjEzNzMiIHgyPSIxNTA1IiB5MT0iOTc5LjIwMzEiIHkyPSI5NzkuMjAzMSIvPjxsaW5lIHN0eWxlPSJzdHJva2U6I0ZGRkZGRjtzdHJva2Utd2lkdGg6MS4wOyIgeDE9IjEzNzMiIHgyPSIxNTA1IiB5MT0iOTk1LjUiIHkyPSI5OTUuNSIvPjxsaW5lIHN0eWxlPSJzdHJva2U6I0ZGRkZGRjtzdHJva2Utd2lkdGg6MS4wOyIgeDE9IjEzNzMiIHgyPSIxNTA1IiB5MT0iMTAxMS43OTY5IiB5Mj0iMTAxMS43OTY5Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTojRkZGRkZGO3N0cm9rZS13aWR0aDoxLjA7IiB4MT0iMTM3MyIgeDI9IjE1MDUiIHkxPSIxMDI4LjA5MzgiIHkyPSIxMDI4LjA5MzgiLz48bGluZSBzdHlsZT0ic3Ryb2tlOiNGRkZGRkY7c3Ryb2tlLXdpZHRoOjEuMDsiIHgxPSIxMzczIiB4Mj0iMTUwNSIgeTE9IjEwNDQuMzkwNiIgeTI9IjEwNDQuMzkwNiIvPjxsaW5lIHN0eWxlPSJzdHJva2U6I0ZGRkZGRjtzdHJva2Utd2lkdGg6MS4wOyIgeDE9IjEzNzMiIHgyPSIxNTA1IiB5MT0iMTA2MC42ODc1IiB5Mj0iMTA2MC42ODc1Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTojRkZGRkZGO3N0cm9rZS13aWR0aDoxLjA7IiB4MT0iMTM3MyIgeDI9IjE1MDUiIHkxPSIxMDc2Ljk4NDQiIHkyPSIxMDc2Ljk4NDQiLz48bGluZSBzdHlsZT0ic3Ryb2tlOiNGRkZGRkY7c3Ryb2tlLXdpZHRoOjEuMDsiIHgxPSIxMzczIiB4Mj0iMTM3MyIgeTE9Ijk2Mi45MDYzIiB5Mj0iMTA3Ni45ODQ0Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTojRkZGRkZGO3N0cm9rZS13aWR0aDoxLjA7IiB4MT0iMTUwNSIgeDI9IjE1MDUiIHkxPSI5NjIuOTA2MyIgeTI9IjEwNzYuOTg0NCIvPjwhLS1NRDU9WzQyZjA1N2I4YjQ5NTM1ZmQyYWUyMGZjM2ViMDEzYWIzXQpAc3RhcnR1bWwNCiFpbmNsdWRlIGh0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS9hZHJpYW52bHVwdS9DNC1QbGFudFVNTC9sYXRlc3QvQzRfQ29udGFpbmVyLnB1bWwNCg0KIWdsb2JhbCAkVVNDX0RFU0MgPSAiUGxhdGZvcm0gd2lkZSB0b29sIGFuZCBmdW5jdGlvbmFsIGltcGxlbWVudGF0aW9ucyBpbmNsdWRpbmcgYXV0aGVudGljYXRpb24gYW5kIGF1dGhvcml6YXRpb24sIG1ldHJpY3MgcHVibGljYXRpb24sIGxvZ2dpbmcgc2VydmljZXMsIGRlcGxveW1lbnQgYW5kIGJ1aWxkIHN5c3RlbXMiDQohZ2xvYmFsICRBU19ERVNDID0gIkhpZ2hlciBsZXZlbCBkYXRhIGZ1bmN0aW9ucyB0byBhY2Nlc3MgYW5kIHRyYW5zZm9ybSBkYXRhLiINCiFnbG9iYWwgJEFEU19ERVNDID0gIlN1YnN5c3RlbSBmb3IgZGV2ZWxvcGluZyBhbmQgYXNzZW1ibGluZyBzY2llbmNlIGFsZ29yaXRobXMgaW50byBhbiBhbGdvcml0aG0gY2F0YWxvZyINCiFnbG9iYWwgJFNQU19ERVNDID0gIlN1YnN5c3RlbSBmb3IgdGhlIGdlbmVyYXRpb24gb2Ygc2NpZW5jZSBkYXRhIHByb2R1Y3RzIHRocm91Z2ggdGhlIGNvbWJpbmF0aW9uIG9mIEFsZ29yaXRobXMgYW5kIERhdGEiDQohZ2xvYmFsICREU19ERVNDID0gIlN1YnN5c3RlbSBmb3IgaW5nZXN0aW9uLCBzdG9yYWdlLCBhbmQgYWNjZXNzIHRvIGRhdGEgcHJvZHVjdHMgZm9yIHVzZSBpbiB0aGUgVW5pdHkgU3lzdGVtLiINCg0KDQpMQVlPVVRfV0lUSF9MRUdFTkQoKQ0KDQpQZXJzb24oYWQsICJBbGdvcml0aG0gRGV2ZWxvcGVyIiwgIlRlYW1zIHJlc3BvbnNpYmxlIGZvciB0aGUgZGV2ZWxvcG1lbnQgb2Ygc2NpZW5jZSBhbGdvcml0aG1zIikNClBlcnNvbihvcCwgIk9wZXJhdG9yIiwgIlRlYW1zIHJlc3BvbnNpYmxlIGZvciB0aGUgb3BlcmF0aW9uYWwgcHJvZHVjdGlvbiBhbmQgbW9uaXRvcmluZyBvZiBwcm9kdWN0cy4iKQ0KUGVyc29uKGN2LCAiQ2FsL1ZhbCIsICJUZWFtcyByZXNwb25zaWJsZSBmb3IgdGhlIGNhbGlicmF0aW9uICYgdmFsaWRhdGlvbiBvZiBkYXRhIHByb2R1Y3RzLiIpDQpQZXJzb25fRXh0KG91LCAiT3RoZXIgVXNlciIsICJVc2VycyBpbnRlcmVzdGVkIGluIGV4YW1pbmluZyBkYXRhIHByb2R1Y3RzLCBhbGdvcml0aG0gcHJvdG90eXBlcywgb3IgJ29wZW4gc2NpZW5jZScgc3R5bGUgaW52ZXN0aWdhdGlvbnMgb2YgcHJvZHVjdCBnZW5lcmF0aW9uICAocmVwcm9kdWNlLCByZS1ydW4sIGV4YW1pbmUpLiIpDQoNClN5c3RlbV9FeHQoZGksICJEYXRhIElucHV0cyIsICJPcmlnaW5hdGluZyBwb2ludCBvZiBkYXRhIGZvciB0aGUgcHJvamVjdC9zY2llbmNlIHRlYW1zIHRvIHByb2Nlc3MgaW50byBoaWdoZXIgbGV2ZWwgcHJvZHVjdHMuIikNClN5c3RlbV9FeHQoYSwgIkFyY2hpdmUiLCAiTG9uZyB0ZXJtIGFyY2hpdmUgZm9yIGRpc3RyaWJ1dGlvbiBvZiBkYXRhIHByb2R1Y3RzIHRvIGVuZCB1c2Vycy4gRXhhbXBsZXMgaW5jbHVkZSBQRFMsIERBQUMsIG9yIG90aGVyIE5BU0EgYXBwcm92ZWQgZW50aXR5LiIpDQoNClN5c3RlbV9Cb3VuZGFyeSh1LCAiVW5pdHkiKSB7DQogICAgQ29udGFpbmVyKGFkcywgIkFsZ29yaXRobSBEZXZlbG9wbWVudCIsICRBRFNfREVTQykNCiAgICBDb250YWluZXIoc3BzLCAiU2NpZW5jZSBQcm9jZXNzaW5nIiwgJFNQU19ERVNDKQ0KICAgIENvbnRhaW5lcl9Cb3VuZGFyeShkYXBhLCAiRGF0YSBBY2Nlc3MgYW5kIFByb2Nlc3NpbmcgQVBJIikgew0KICAgICAgQ29udGFpbmVyKGRzLCAiRGF0YSBTZXJ2aWNlcyIsICREU19ERVNDKQ0KICAgICAgQ29udGFpbmVyKGFzLCAiQW5hbHlzaXMgU2VydmljZXMiLCAkQVNfREVTQykNCiAgICB9DQogICAgQ29udGFpbmVyKGNzLCAiQ29tbW9uIFNlcnZpY2VzIiwgJFVTQ19ERVNDKQ0KDQogICAgUmVsKGFkcywgc3BzLCAiQWxnb3JpdGhtIENhdGFsb2ciLCAiQVBJIikNCn0NCg0KUmVsKGRpLCBkcywgIkRlbGl2ZXIgb3Igc3RhZ2UgZGF0YSBwcm9kdWN0cyBmb3IgcHJvY2Vzc2luZyIpDQpSZWwoZHMsIGEsICJTZW5kcyBkYXRhIHRvIGFyY2hpdmUiKQ0KUmVsKGFkLCBhZHMsICJMb2dpbiB0byBkZXZlbG9wIGFsZ29yaXRobXMsIHRlc3QgYWxnb3JpdGhtcywgb3BlcmF0aW9uYWxpemUgd29ya2Zsb3dzLCBleGVjdXRlIGFuZCBtb25pdG9yIG9wZXJhdGlvbmFsIHdvcmtmbG93cywgdmFsaWRhdGUgcHJvZHVjdHMiLCAiVUkiKQ0KUmVsKG9wLCBzcHMsICJlbnN1cmUgb25nb2luZyBwcm9kdWN0IGdlbmVyYXRpb24sIG1vbml0b3IgcHJvY2Vzc2luZywgdHJpYWdlIGlzc3VlcywgZW5zdXJlIGFyY2hpdmUgZGVsaXZlcnkiKQ0KUmVsKGN2LGFkcywgIkNhbGlicmF0ZSBhbGdvcml0aG1zIGFuZCB2YWxpZGF0ZSBnZW5lcmF0ZWQgZGF0YSB1c2luZyBleGlzdGluZyBkYXRhIHByb2R1Y3RzIikNClJlbChvdSwgZGFwYSwgIlVzZXJzIGludGVyZXN0ZWQgaW4gZXhhbWluaW5nIGRhdGEgcHJvZHVjdHMsIGFsZ29yaXRobSBwcm90b3R5cGVzLCBvciAnb3BlbiBzY2llbmNlJyBzdHlsZSBpbnZlc3RpZ2F0aW9ucyBvZiBwcm9kdWN0IGdlbmVyYXRpb24gIChyZXByb2R1Y2UsIHJlLXJ1biwgZXhhbWluZSkiKQ0KUmVsKGRhcGEsIHNwcywgIlByb3ZpZGVzIGRhdGEgdG8gcHJvY2Vzc2luZyBzeXN0ZW0gYW5kIGNhdGFsb2dzIHByb2Nlc3NpbmcgcmVzdWx0cyIpDQoNCkBlbmR1bWwNCgpAc3RhcnR1bWwNCg0KDQoNCg0KDQpza2lucGFyYW0gZGVmYXVsdFRleHRBbGlnbm1lbnQgY2VudGVyDQoNCnNraW5wYXJhbSB3cmFwV2lkdGggMjAwDQpza2lucGFyYW0gbWF4TWVzc2FnZVNpemUgMTUwDQoNCnNraW5wYXJhbSBMZWdlbmRCb3JkZXJDb2xvciB0cmFuc3BhcmVudA0Kc2tpbnBhcmFtIExlZ2VuZEJhY2tncm91bmRDb2xvciB0cmFuc3BhcmVudA0Kc2tpbnBhcmFtIExlZ2VuZEZvbnRDb2xvciAjRkZGRkZGDQoNCnNraW5wYXJhbSByZWN0YW5nbGUgew0KICAgIFN0ZXJlb3R5cGVGb250U2l6ZSAxMg0KICAgIHNoYWRvd2luZyBmYWxzZQ0KfQ0KDQpza2lucGFyYW0gZGF0YWJhc2Ugew0KICAgIFN0ZXJlb3R5cGVGb250U2l6ZSAxMg0KICAgIHNoYWRvd2luZyBmYWxzZQ0KfQ0KDQpza2lucGFyYW0gcXVldWUgew0KICAgIFN0ZXJlb3R5cGVGb250U2l6ZSAxMg0KICAgIHNoYWRvd2luZyBmYWxzZQ0KfQ0KDQpza2lucGFyYW0gQXJyb3cgew0KICAgIENvbG9yICM2NjY2NjYNCiAgICBGb250Q29sb3IgIzY2NjY2Ng0KICAgIEZvbnRTaXplIDEyDQp9DQoNCnNraW5wYXJhbSByZWN0YW5nbGU8PGJvdW5kYXJ5Pj4gew0KICAgIFNoYWRvd2luZyBmYWxzZQ0KICAgIFN0ZXJlb3R5cGVGb250U2l6ZSAwDQogICAgRm9udENvbG9yICM0NDQ0NDQNCiAgICBCb3JkZXJDb2xvciAjNDQ0NDQ0DQogICAgQm9yZGVyU3R5bGUgZGFzaGVkDQp9DQoNCg0KDQoNCg0KDQoNCg0KDQoNCg0KDQoNCg0KDQoNCg0KDQoNCg0KDQoNCg0KDQoNCg0KDQoNCg0Kc2tpbnBhcmFtIHJlY3RhbmdsZTw8cGVyc29uPj4gew0KICAgIFN0ZXJlb3R5cGVGb250Q29sb3IgI0ZGRkZGRg0KICAgIEZvbnRDb2xvciAjRkZGRkZGDQogICAgQmFja2dyb3VuZENvbG9yICMwODQyN0INCiAgICBCb3JkZXJDb2xvciAjMDczQjZGDQp9DQoNCnNraW5wYXJhbSByZWN0YW5nbGU8PGV4dGVybmFsX3BlcnNvbj4+IHsNCiAgICBTdGVyZW90eXBlRm9udENvbG9yICNGRkZGRkYNCiAgICBGb250Q29sb3IgI0ZGRkZGRg0KICAgIEJhY2tncm91bmRDb2xvciAjNjg2ODY4DQogICAgQm9yZGVyQ29sb3IgIzhBOEE4QQ0KfQ0KDQpza2lucGFyYW0gcmVjdGFuZ2xlPDxzeXN0ZW0+PiB7DQogICAgU3RlcmVvdHlwZUZvbnRDb2xvciAjRkZGRkZGDQogICAgRm9udENvbG9yICNGRkZGRkYNCiAgICBCYWNrZ3JvdW5kQ29sb3IgIzExNjhCRA0KICAgIEJvcmRlckNvbG9yICMzQzdGQzANCn0NCg0Kc2tpbnBhcmFtIHJlY3RhbmdsZTw8ZXh0ZXJuYWxfc3lzdGVtPj4gew0KICAgIFN0ZXJlb3R5cGVGb250Q29sb3IgI0ZGRkZGRg0KICAgIEZvbnRDb2xvciAjRkZGRkZGDQogICAgQmFja2dyb3VuZENvbG9yICM5OTk5OTkNCiAgICBCb3JkZXJDb2xvciAjOEE4QThBDQp9DQoNCnNwcml0ZSAkcGVyc29uIFs0OHg0OC8xNl0gew0KMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwMDAwMDAwMDAwNDlCQ0NBNzIwMDAwMDAwMDAwMDAwMDAwMDAwMA0K<KEY>) [Download system diagram](system.svg ':ignore') **Level 2: Container diagram** Once you understand how your system fits in to the overall IT environment, a really useful next step is to zoom-in to the system boundary with a Container diagram. A "container" is something like a server-side web application, single-page application, desktop application, mobile app, database schema, file system, etc. Essentially, a container is a separately runnable/deployable unit (e.g. a separate process space) that executes code or stores data. The Container diagram shows the high-level shape of the software architecture and how responsibilities are distributed across it. It also shows the major technology choices and how the containers communicate with one another. It's a simple, high-level technology focussed diagram that is useful for software developers and support/operations staff alike. **Scope**: A single software system. **Primary elements**: Containers within the software system in scope. Supporting elements: People and software systems directly connected to the containers. **Intended audience**: Technical people inside and outside of the software development team; including software architects, developers and operations/support staff. **Notes**: This diagram says nothing about deployment scenarios, clustering, replication, failover, etc. ======================= File: docs/2. Unity Diagrams/Data Access/README.md ======================= # Data Access `/2. Unity Diagrams/Data Access` * [Overview](../../README.md) * [1. Unity Architecture](../../1.%20Unity%20Architecture/README.md) * [Algorithm Development](../../1.%20Unity%20Architecture/Algorithm%20Development/README.md) * [Application Catalog](../../1.%20Unity%20Architecture/Algorithm%20Development/Application%20Catalog/README.md) * [Analysis Services](../../1.%20Unity%20Architecture/Analysis%20Services/README.md) * [Common Services](../../1.%20Unity%20Architecture/Common%20Services/README.md) * [Data Services](../../1.%20Unity%20Architecture/Data%20Services/README.md) * [Science Processing](../../1.%20Unity%20Architecture/Science%20Processing/README.md) * [2. Unity Diagrams](../../2.%20Unity%20Diagrams/README.md) * [Algorithm Execution](../../2.%20Unity%20Diagrams/Algorithm%20Execution/README.md) * [**Data Access**](../../2.%20Unity%20Diagrams/Data%20Access/README.md) * [Process Execution](../../2.%20Unity%20Diagrams/Process%20Execution/README.md) * [Process Deploment](../../2.%20Unity%20Diagrams/Process%20Execution/Process%20Deploment/README.md) * [Process Request](../../2.%20Unity%20Diagrams/Process%20Execution/Process%20Request/README.md) * [Process Status](../../2.%20Unity%20Diagrams/Process%20Execution/Process%20Status/README.md) * [Processing Response](../../2.%20Unity%20Diagrams/Process%20Execution/Processing%20Response/README.md) * [3. Deployment Diagrams](../../3.%20Deployment%20Diagrams/README.md) * [4. Unity Glossary](../../4.%20Unity%20Glossary/README.md) --- [2. Unity Diagrams (up)](../../2.%20Unity%20Diagrams/README.md) --- # DAPA API The Data Access and Processing API is a way of commonly defining access and available transformations to a given data product. It is the main point of interaction for consumers of Unity data, and should be agnostic to the underlying data container (e.g. netCDF, binary, zarr). A formal OpenAPI definition is to follow | End Point | Result | Implementing Service Area | | ----------- | ----------- | ----| | {root}| the main endpoint for the Unity API | Unknown | | {root}/collections | basic Listing and Search for collections within the Unity system | U-DS | | {root}/collections/{collectionId} | Collection information for the given collection | U-DS | | {root}/collections/{collectionId}/items | list of files within the collection, bbox and datetime are the most likely 'filters' to be applied. | U-DS | | {root}/collections/{collectionId}/variables | variable definitions for measurements and observations within the collection | U-DS | | {root}/collections/{collectionId}/processes | DAPA Processes that can be applied to the specified collection | U-AS | | {root}/collections/{collectionId}/processes/area:retrieve | subset data by time and space | U-AS | Example User Stories are as follows: <table> <tr> <td>User Story</td> <td colspan="3">As a user, I want to find data in the system for a given collection that covers a specific time and space and then access</td> </tr> <tr> <td>End Point</td> <td>{root}/collections/{collectionId}/items</td> <td>query</td> <td>bbox=11.49,48.05,11.66,48.22&datetime=2018-02-12T00&#58;00&#58;00Z/2018-03-18T12&#58;31&#58;12Z</td> </tr> </table> <table> <tr> <td>User Story</td> <td colspan="3">As a user, I want to *subset* data in the system for a given collection that covers a specific time and space</td> </tr> <tr> <td>End Point</td> <td>{root}/collections/{collectionId}/processes/area:retrieve</td> <td>query</td> <td>bbox=11.49,48.05,11.66,48.22&datetime=2018-02-12T00&#58;00&#58;00Z/2018-03-18T12&#58;31&#58;12Z</td> </tr> </table> https://docs.ogc.org/bp/20-089r1.html#toc38 ======================= File: docs/README.md ======================= # Overview * [**Overview**](README.md) * [1. Unity Architecture](1.%20Unity%20Architecture/README.md) * [Algorithm Development](1.%20Unity%20Architecture/Algorithm%20Development/README.md) * [Application Catalog](1.%20Unity%20Architecture/Algorithm%20Development/Application%20Catalog/README.md) * [Analysis Services](1.%20Unity%20Architecture/Analysis%20Services/README.md) * [Common Services](1.%20Unity%20Architecture/Common%20Services/README.md) * [Data Services](1.%20Unity%20Architecture/Data%20Services/README.md) * [Science Processing](1.%20Unity%20Architecture/Science%20Processing/README.md) * [2. Unity Diagrams](2.%20Unity%20Diagrams/README.md) * [Algorithm Execution](2.%20Unity%20Diagrams/Algorithm%20Execution/README.md) * [Data Access](2.%20Unity%20Diagrams/Data%20Access/README.md) * [Process Execution](2.%20Unity%20Diagrams/Process%20Execution/README.md) * [Process Deploment](2.%20Unity%20Diagrams/Process%20Execution/Process%20Deploment/README.md) * [Process Request](2.%20Unity%20Diagrams/Process%20Execution/Process%20Request/README.md) * [Process Status](2.%20Unity%20Diagrams/Process%20Execution/Process%20Status/README.md) * [Processing Response](2.%20Unity%20Diagrams/Process%20Execution/Processing%20Response/README.md) * [3. Deployment Diagrams](3.%20Deployment%20Diagrams/README.md) * [4. Unity Glossary](4.%20Unity%20Glossary/README.md) --- - [1. Unity Architecture](1.%20Unity%20Architecture/README.md) - [2. Unity Diagrams](2.%20Unity%20Diagrams/README.md) - [3. Deployment Diagrams](3.%20Deployment%20Diagrams/README.md) - [4. Unity Glossary](4.%20Unity%20Glossary/README.md) --- ![context](data:image/svg+xml;base64,<KEY>MDAwMDAwMDAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMDAwMDAwMDA0OUJDQ0E3MjAwMDAwMDAwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDAwMDAwMDA2RUZGRkZGRkZGQjMwMDAwMDAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwMDAwMDAxQ0ZGRkZGRkZGRkZGRjcwMDAwMDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMDAwMUVGRkZGRkZGRkZGRkZGRjgwMDAwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDAwMDBDRkZGRkZGRkZGRkZGRkZGRjYwMDAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwMDAwN0ZGRkZGRkZGRkZGRkZGRkZGRjEwMDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMDFGRkZGRkZGRkZGRkZGRkZGRkZGOTAwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDAwNkZGRkZGRkZGRkZGRkZGRkZGRkZGMDAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwMDBCRkZGRkZGRkZGRkZGRkZGRkZGRkY0MDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMEVGRkZGRkZGRkZGRkZGRkZGRkZGRjcwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDAwRkZGRkZGRkZGRkZGRkZGRkZGRkZGODAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwMDBGRkZGRkZGRkZGRkZGRkZGRkZGRkY4MDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMERGRkZGRkZGRkZGRkZGRkZGRkZGRjYwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDAwQUZGRkZGRkZGRkZGRkZGRkZGRkZGNDAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwMDA2RkZGRkZGRkZGRkZGRkZGRkZGRkUwMDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMDBFRkZGRkZGRkZGRkZGRkZGRkZGODAwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDAwMDdGRkZGRkZGRkZGRkZGRkZGRkYxMDAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwMDAwMEJGRkZGRkZGRkZGRkZGRkZGNTAwMDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMDAwMURGRkZGRkZGRkZGRkZGRjcwMDAwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDAwMDAwMEJGRkZGRkZGRkZGRkY1MDAwMDAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwMDAwMDAwMDVERkZGRkZGRkZBMTAwMDAwMDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMDAwMDAwMDAzN0FCQjk2MTAwMDAwMDAwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMDI1Nzg4MzAwMDAwMDAwMDA1ODg2NDEwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDdERkZGRkZGRDk2NDMzNDdCRkZGRkZGRkI0MDAwMDAwMDAwMDANCjAwMDAwMDAwMDRFRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZCMTAwMDAwMDAwMA0KMDAwMDAwMDA3RkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZEMjAwMDAwMDAwDQowMDAwMDAwNkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZFMTAwMDAwMDANCjAwMDAwMDNGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZCMDAwMDAwMA0KMDAwMDAwQkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkY1MDAwMDAwDQowMDAwMDNGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkQwMDAwMDANCjAwMDAwOUZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRjIwMDAwMA0KMDAwMDBERkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGNjAwMDAwDQowMDAwMEZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkY4MDAwMDANCjAwMDAxRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkEwMDAwMA0KMDAwMDFGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGQjAwMDAwDQowMDAwMUZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZCMDAwMDANCjAwMDAxRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkIwMDAwMA0KMDAwMDFGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGQTAwMDAwDQowMDAwMEVGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkY3MDAwMDANCjAwMDAwNkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRTEwMDAwMA0KMDAwMDAwOEZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkQzMDAwMDAwDQowMDAwMDAwMTQ1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTUzMDAwMDAwMDANCjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwDQp9DQoNCg0KDQoNCg0KDQoNCg0KDQoNCg0KDQpoaWRlIHN0ZXJlb3R5cGUNCmxlZ2VuZCByaWdodA0KfDxjb2xvcjojMDAwMDAwPioqTGVnZW5kKio8L2NvbG9yPiB8DQp8PCMwODQyN0I+IHBlcnNvbiB8DQp8PCMxMTY4QkQ+IHN5c3RlbXwNCnw8IzY4Njg2OD4gZXh0ZXJuYWwgcGVyc29uIHwNCnw8Izk5OTk5OT4gZXh0ZXJuYWwgc3lzdGVtIHwNCmVuZGxlZ2VuZA0KDQpyZWN0YW5nbGUgIjwkcGVyc29uPlxuPT1BbGdvcml0aG0gRGV2ZWxvcGVyXG5cbiBUZWFtcyByZXNwb25zaWJsZSBmb3IgdGhlIGRldmVsb3BtZW50IG9mIHNjaWVuY2UgYWxnb3JpdGhtcyIgPDxwZXJzb24+PiBhcyBhZA0KcmVjdGFuZ2xlICI8JHBlcnNvbj5cbj09T3BlcmF0b3JcblxuIFRlYW1zIHJlc3BvbnNpYmxlIGZvciB0aGUgb3BlcmF0aW9uYWwgcHJvZHVjdGlvbiBhbmQgbW9uaXRvcmluZyBvZiBwcm9kdWN0cy4iIDw8cGVyc29uPj4gYXMgb3ANCnJlY3RhbmdsZSAiPCRwZXJzb24+XG49PUNhbC9WYWxcblxuIFRlYW1zIHJlc3BvbnNpYmxlIGZvciB0aGUgY2FsaWJyYXRpb24gJiB2YWxpZGF0aW9uIG9mIGRhdGEgcHJvZHVjdHMuIiA8PHBlcnNvbj4+IGFzIGN2DQpyZWN0YW5nbGUgIjwkcGVyc29uPlxuPT1PdGhlciBVc2VyXG5cbiBVc2VycyBpbnRlcmVzdGVkIGluIGV4YW1pbmluZyBkYXRhIHByb2R1Y3RzLCBhbGdvcml0aG0gcHJvdG90eXBlcywgb3IgJ29wZW4gc2NpZW5jZScgc3R5bGUgaW52ZXN0aWdhdGlvbnMgb2YgcHJvZHVjdCBnZW5lcmF0aW9uICAocmVwcm9kdWNlLCByZS1ydW4sIGV4YW1pbmUpLiIgPDxleHRlcm5hbF9wZXJzb24+PiBhcyBvdQ0KDQpyZWN0YW5nbGUgIj09VW5pdHlcblxuIEFsbG93cyB1c2VycyB0byBkZXZlbG9wLCBvcGVyYXRpb25hbGl6ZSwgYW5kIGdlbmVyYXRlIHNjaWVuY2UgcHJvZHVjdHMsIHRoZWlyIGFsZ29yaXRobXMsIGFuZCB0aGVpciB3b3JrZmxvd3MgdGhyb3VnaCBzdGFuZGFyZCBpbnRlcmZhY2VzLiBBbGxvd3MgYW5hbHlzaXMgb2YgdGhlIHJlc3VsdGluZyBkYXRhIHByb2R1Y3RzIGZvciB2YWxpZGF0aW9uIGFzIHdlbGwgYXMgZGF0YSB1c2UuIEluY2x1ZGVzIHByb3ZlbmFuY2UgaW5mb3JtYXRpb24gZm9yIGRpZmZlcmVudCBjb21wb25lbnRzIG9mIHRoZSBzeXN0ZW0uIiA8PHN5c3RlbT4+IGFzIHUNCnJlY3RhbmdsZSAiPT1EYXRhIElucHV0c1xuXG4gT3JpZ2luYXRpbmcgcG9pbnQgb2YgZGF0YSBmb3IgdGhlIHByb2plY3Qvc2NpZW5jZSB0ZWFtcyB0byBwcm9jZXNzIGludG8gaGlnaGVyIGxldmVsIHByb2R1Y3RzLiIgPDxleHRlcm5hbF9zeXN0ZW0+PiBhcyBkaQ0KcmVjdGFuZ2xlICI9PUFyY2hpdmVcblxuIExvbmcgdGVybSBhcmNoaXZlIGZvciBkaXN0cmlidXRpb24gb2YgZGF0YSBwcm9kdWN0cyB0byBlbmQgdXNlcnMuIEV4YW1wbGVzIGluY2x1ZGUgUERTLCBEQUFDLCBvciBvdGhlciBOQVNBIGFwcHJvdmVkIGVudGl0eS4iIDw8ZXh0ZXJuYWxfc3lzdGVtPj4gYXMgYQ0KDQpkaSAtIC0+PiB1IDogKipEZWxpdmVyIG9yIHN0YWdlIGRhdGEgcHJvZHVjdHMgZm9yIHByb2Nlc3NpbmcqKg0KdSAtIC0+PiBhIDogKipTZW5kcyBkYXRhIHRvIGFyY2hpdmUqKg0KYWQgLSAtPj4gdSA6ICoqTG9naW4gdG8gZGV2ZWxvcCBhbGdvcml0aG1zLCB0ZXN0IGFsZ29yaXRobXMsIG9wZXJhdGlvbmFsaXplIHdvcmtmbG93cywgZXhlY3V0ZSBhbmQgbW9uaXRvciBvcGVyYXRpb25hbCB3b3JrZmxvd3MsIHZhbGlkYXRlIHByb2R1Y3RzKipcbi8vPHNpemU6MTI+W1VJXTwvc2l6ZT4vLw0Kb3AgLSAtPj4gdSA6ICoqZW5zdXJlIG9uZ29pbmcgcHJvZHVjdCBnZW5lcmF0aW9uLCBtb25pdG9yIHByb2Nlc3NpbmcsIHRyaWFnZSBpc3N1ZXMsIGVuc3VyZSBhcmNoaXZlIGRlbGl2ZXJ5KioNCmN2IC0gLT4+IHUgOiAqKkNhbGlicmF0ZSBhbGdvcml0aG1zIGFuZCB2YWxpZGF0ZSBnZW5lcmF0ZWQgZGF0YSB1c2luZyBleGlzdGluZyBkYXRhIHByb2R1Y3RzKioNCm91IC0gLT4+IHUgOiAqKlVzZXJzIGludGVyZXN0ZWQgaW4gZXhhbWluaW5nIGRhdGEgcHJvZHVjdHMsIGFsZ29yaXRobSBwcm90b3R5cGVzLCBvciAnb3BlbiBzY2llbmNlJyBzdHlsZSBpbnZlc3RpZ2F0aW9ucyBvZiBwcm9kdWN0IGdlbmVyYXRpb24gIChyZXByb2R1Y2UsIHJlLXJ1biwgZXhhbWluZSkqKg0KQGVuZHVtbA0KClBsYW50VU1MIHZlcnNpb24gMS4yMDIyLjMoVHVlIE1hciAyOSAxNjoxMDo1NyBHTVQgMjAyMikKKEdQTCBzb3VyY2UgZGlzdHJpYnV0aW9uKQpKYXZhIFJ1bnRpbWU6IE9wZW5KREsgUnVudGltZSBFbnZpcm9ubWVudApKVk06IE9wZW5KREsgNjQtQml0IFNlcnZlciBWTQpEZWZhdWx0IEVuY29kaW5nOiBVVEYtOApMYW5ndWFnZTogZW4KQ291bnRyeTogVVMKLS0+PC9nPjwvc3ZnPg==) [Download context diagram](context.svg ':ignore') # Unity System Context Diagram The Unity system context diagram shows where the Unity system lives in relation to other pieces of the Science Processing ecosystem. For example, the context diagram above shows that 'archive' functionality happens *after* the Unity systems interactions. For more information on the Unity system, continue to explore the diagrams and architecture presented here. ======================= File: README.md ======================= <!-- Header block for project --> <hr> <div align="center"> ![logo](https://user-images.githubusercontent.com/3129134/163255685-857aa780-880f-4c09-b08c-4b53bf4af54d.png) <h1 align="center">Unity Architecture</h1> <!-- ☝️ Replace with your repo name ☝️ --> </div> <pre align="center">Location to discuss the Unity architecture in the public domain</pre> <!-- ☝️ Replace with a single sentence describing the purpose of your repo / proj ☝️ --> <!-- Header block for project --> [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](code_of_conduct.md) <!-- ☝️ Add badges via: https://shields.io e.g.![](https://img.shields.io/github/your_chosen_action/your_org/your_repo) ☝️ --> ![Screen Shot 2022-04-13 at 6 43 47 PM](https://user-images.githubusercontent.com/3129134/163297458-fd2e4933-cb50-43b8-b643-fd5ef29a83f0.png) This repository contains detailed architectural diagrams across all Unity service areas. The diagrams follow [C4 architectural diagram standards](https://c4model.com), with UML diagrams for lower level diagrams. <!-- ☝️ Replace with a more detailed description of your repository, including why it was made and whom its intended for. ☝️ --> [Website](https://unity-sds.github.io/unity-architecture/#/) | [Wiki](https://github.com/unity-sds/unity-architecture/wiki) | Discussion Board (TBD) | [Issue Tracker](https://github.com/unity-sds/unity-architecture/issues) ## Features * Architectural overview of the Unity SDS-as-a-Service framework * Process diagrams detailing communication between difference Unity service areas and components <!-- ☝️ Replace with a bullet-point list of your features ☝️ --> ## Contents * [Quick Start](#quick-start) * [Changelog](#changelog) * [FAQ](#frequently-asked-questions-faq) * [Contributing Guide](#contributing) * [License](#license) * [Support](#support) ## Quick Start This guide provides a quick way to get started with our project, including how to build and view the architectural diagrams within this repository. Please see our docs (TBD) for a more comprehensive overview. View the live architecture diagrams here: https://unity-sds.github.io/unity-architecture/#/ ### Build Instructions Requirements: * [C4-Builder](https://adrianvlupu.github.io/C4-Builder/#/?id=overview) * [Node Package Manager (NPM)](https://www.npmjs.com) TBD <!-- ☝️ Replace with a numbered list of your build instructions, including expected results / outputs with optional screenshots ☝️ --> ### Test Instructions TBD <!-- ☝️ Replace with a numbered list of your test instructions, including expected results / outputs with optional screenshots ☝️ --> ## Changelog See our [CHANGELOG.md](CHANGELOG.md) for a history of our changes. See our [releases page](https://github.com/unity-sds/unity-architecture/releases) for our key versioned releases. <!-- ☝️ Replace with links to your changelog and releases page ☝️ --> ## Frequently Asked Questions (FAQ) Questions about our project? Please see our: FAQ (TBD) <!-- ☝️ Replace with a list of frequently asked questions from your project, or post a link to your FAQ on a discussion board ☝️ --> ## Contributing Interested in contributing to our project? Please see our: [CONTRIBUTING.md](CONTRIBUTING.md) ## License See our: [LICENSE](LICENSE) ## Support Key points of contact are: [@mike-gangl](https://github.com/mike-gangl) [@hookhua](https://github.com/hookhua) <!-- ☝️ Replace with the key individuals who should be contacted for questions ☝️ --> ======================= File: src/context.md ======================= # Unity System Context Diagram The Unity system context diagram shows where the Unity system lives in relation to other pieces of the Science Processing ecosystem. For example, the context diagram above shows that 'archive' functionality happens *after* the Unity systems interactions. For more information on the Unity system, continue to explore the diagrams and architecture presented here. ======================= File: docs/_sidebar.md ======================= <gh_stars>1-10 * [Overview](HOME) * [1. Unity Architecture](1.%20Unity%20Architecture/HOME) * [Algorithm Development](1.%20Unity%20Architecture/Algorithm%20Development/HOME) * [Application Catalog](1.%20Unity%20Architecture/Algorithm%20Development/Application%20Catalog/HOME) * [Analysis Services](1.%20Unity%20Architecture/Analysis%20Services/HOME) * [Common Services](1.%20Unity%20Architecture/Common%20Services/HOME) * [Data Services](1.%20Unity%20Architecture/Data%20Services/HOME) * [Science Processing](1.%20Unity%20Architecture/Science%20Processing/HOME) * [2. Unity Diagrams](2.%20Unity%20Diagrams/HOME) * [Algorithm Execution](2.%20Unity%20Diagrams/Algorithm%20Execution/HOME) * [Data Access](2.%20Unity%20Diagrams/Data%20Access/HOME) * [Process Execution](2.%20Unity%20Diagrams/Process%20Execution/HOME) * [Process Deploment](2.%20Unity%20Diagrams/Process%20Execution/Process%20Deploment/HOME) * [Process Request](2.%20Unity%20Diagrams/Process%20Execution/Process%20Request/HOME) * [Process Status](2.%20Unity%20Diagrams/Process%20Execution/Process%20Status/HOME) * [Processing Response](2.%20Unity%20Diagrams/Process%20Execution/Processing%20Response/HOME) * [3. Deployment Diagrams](3.%20Deployment%20Diagrams/HOME) * [4. Unity Glossary](4.%20Unity%20Glossary/HOME) ======================= File: docs/1. Unity Architecture/Common Services/HOME.md ======================= # Common Services ![system](data:image/svg+xml;base64,PD<KEY>iB<KEY>) [Download system diagram](system.svg ':ignore') # Common Services ======================= File: docs/1. Unity Architecture/Analysis Services/README.md ======================= <reponame>unity-sds/unity-architecture<gh_stars>1-10 # Analysis Services `/1. Unity Architecture/Analysis Services` * [Overview](../../README.md) * [1. Unity Architecture](../../1.%20Unity%20Architecture/README.md) * [Algorithm Development](../../1.%20Unity%20Architecture/Algorithm%20Development/README.md) * [Application Catalog](../../1.%20Unity%20Architecture/Algorithm%20Development/Application%20Catalog/README.md) * [**Analysis Services**](../../1.%20Unity%20Architecture/Analysis%20Services/README.md) * [Common Services](../../1.%20Unity%20Architecture/Common%20Services/README.md) * [Data Services](../../1.%20Unity%20Architecture/Data%20Services/README.md) * [Science Processing](../../1.%20Unity%20Architecture/Science%20Processing/README.md) * [2. Unity Diagrams](../../2.%20Unity%20Diagrams/README.md) * [Algorithm Execution](../../2.%20Unity%20Diagrams/Algorithm%20Execution/README.md) * [Data Access](../../2.%20Unity%20Diagrams/Data%20Access/README.md) * [Process Execution](../../2.%20Unity%20Diagrams/Process%20Execution/README.md) * [Process Deploment](../../2.%20Unity%20Diagrams/Process%20Execution/Process%20Deploment/README.md) * [Process Request](../../2.%20Unity%20Diagrams/Process%20Execution/Process%20Request/README.md) * [Process Status](../../2.%20Unity%20Diagrams/Process%20Execution/Process%20Status/README.md) * [Processing Response](../../2.%20Unity%20Diagrams/Process%20Execution/Processing%20Response/README.md) * [3. Deployment Diagrams](../../3.%20Deployment%20Diagrams/README.md) * [4. Unity Glossary](../../4.%20Unity%20Glossary/README.md) --- [1. Unity Architecture (up)](../../1.%20Unity%20Architecture/README.md) --- ![system](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBjb250ZW50U3R5bGVUeXBlPSJ0ZXh0L2NzcyIgaGVpZ2h0PSIxMDQ3cHgiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiIHN0eWxlPSJ3aWR0aDo2NzFweDtoZWlnaHQ6MTA0N3B4O2JhY2tncm91bmQ6I0ZGRkZGRjsiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDY3MSAxMDQ3IiB3aWR0aD0iNjcxcHgiIHpvb21BbmRQYW49Im1hZ25pZnkiPjxkZWZzLz48Zz48IS0tTUQ1PVtlOTQzZGYzYWIxMmRkZjZkODRiN2ViYzYxNzJkYzM3M10KY2x1c3RlciBhcy0tPjxnIGlkPSJjbHVzdGVyX2FzIj48cmVjdCBoZWlnaHQ9IjM5NiIgcng9IjIuNSIgcnk9IjIuNSIgc3R5bGU9InN0cm9rZTojNDQ0NDQ0O3N0cm9rZS13aWR0aDoxLjA7ZmlsbDpub25lO3N0cm9rZS1kYXNoYXJyYXk6Ny4wLDcuMDsiIHdpZHRoPSIyMzQiIHg9IjciIHk9IjI2NSIvPjx0ZXh0IGZpbGw9IiM0NDQ0NDQiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE2IiBmb250LXdlaWdodD0iYm9sZCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIxNTAiIHg9IjQ5IiB5PSIyODEuODUxNiI+YW5hbHlzaXMgU2VydmljZXM8L3RleHQ+PHRleHQgZmlsbD0iIzQ0NDQ0NCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTIiIGZvbnQtd2VpZ2h0PSJib2xkIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjYyIiB4PSI5MyIgeT0iMjk2Ljc2MzciPltTeXN0ZW1dPC90ZXh0PjwvZz48IS0tTUQ1PVs1NDcyODljZjBhMzhkZjk5ZmNkOTg0NTY0NzkzMzcxNl0KZW50aXR5IHRybnNmcm0tLT48ZyBpZD0iZWxlbV90cm5zZnJtIj48cmVjdCBmaWxsPSIjNDM4REQ1IiBoZWlnaHQ9IjEwMy44MTI1IiByeD0iMi41IiByeT0iMi41IiBzdHlsZT0ic3Ryb2tlOiMzQzdGQzA7c3Ryb2tlLXdpZHRoOjAuNTsiIHdpZHRoPSIyMDIiIHg9IjIzIiB5PSIzMTYiLz48dGV4dCBmaWxsPSIjRkZGRkZGIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNiIgZm9udC13ZWlnaHQ9ImJvbGQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iMTM2IiB4PSI1MyIgeT0iMzQwLjg1MTYiPlRyYW5zZm9ybWF0aW9uPC90ZXh0Pjx0ZXh0IGZpbGw9IiNGRkZGRkYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE2IiBmb250LXdlaWdodD0iYm9sZCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSI2NSIgeD0iOTEuNSIgeT0iMzU5LjQ3NjYiPlNlcnZpY2U8L3RleHQ+PHRleHQgZmlsbD0iI0ZGRkZGRiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTIiIGZvbnQtc3R5bGU9Iml0YWxpYyIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSI4MSIgeD0iODMuNSIgeT0iMzc0LjM4ODciPltXQ1MsIFdDUFNdPC90ZXh0Pjx0ZXh0IGZpbGw9IiNGRkZGRkYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjQiIHg9IjEyMiIgeT0iMzkwLjIxMzkiPsKgPC90ZXh0Pjx0ZXh0IGZpbGw9IiNGRkZGRkYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjE3OCIgeD0iMzciIHk9IjQwNi41MTA3Ij5UcmFuc2Zvcm1zIGRhdGEgcHJvZHVjdHM8L3RleHQ+PC9nPjwhLS1NRDU9W2RiYzI3ODlmMGY0N2UxYjY5NmNjNGUyNzM1Zjg2YjA1XQplbnRpdHkgYW9kcy0tPjxnIGlkPSJlbGVtX2FvZHMiPjxyZWN0IGZpbGw9IiM0MzhERDUiIGhlaWdodD0iMTM2LjQwNjMiIHJ4PSIyLjUiIHJ5PSIyLjUiIHN0eWxlPSJzdHJva2U6IzNDN0ZDMDtzdHJva2Utd2lkdGg6MC41OyIgd2lkdGg9IjIwMyIgeD0iMjIuNSIgeT0iNTA5Ii8+PHRleHQgZmlsbD0iI0ZGRkZGRiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTYiIGZvbnQtd2VpZ2h0PSJib2xkIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjE2NSIgeD0iMzguNSIgeT0iNTMzLjg1MTYiPkFuYWx5c2lzIE9wdGltaXplZDwvdGV4dD48dGV4dCBmaWxsPSIjRkZGRkZGIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNiIgZm9udC13ZWlnaHQ9ImJvbGQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iMTc2IiB4PSIzNiIgeT0iNTUyLjQ3NjYiPkRhdGEgU3RvcmVzIChBT0RTKTwvdGV4dD48dGV4dCBmaWxsPSIjRkZGRkZGIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMiIgZm9udC1zdHlsZT0iaXRhbGljIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjEwIiB4PSIxMTkiIHk9IjU2Ny4zODg3Ij5bXTwvdGV4dD48dGV4dCBmaWxsPSIjRkZGRkZGIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSI0IiB4PSIxMjIiIHk9IjU4My4yMTM5Ij7CoDwvdGV4dD48dGV4dCBmaWxsPSIjRkZGRkZGIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIxNzUiIHg9IjM2LjUiIHk9IjU5OS41MTA3Ij5TdG9yYWdlIG9mIG5vbi1vcHRpbWl6ZWQ8L3RleHQ+PHRleHQgZmlsbD0iI0ZGRkZGRiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iMTc2IiB4PSIzNCIgeT0iNjE1LjgwNzYiPmRhdGEgaW4gYW5hbHlzaXMgb3B0aW1pemVkPC90ZXh0Pjx0ZXh0IGZpbGw9IiNGRkZGRkYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjUyIiB4PSI5OCIgeT0iNjMyLjEwNDUiPmZvcm1hdHM8L3RleHQ+PC9nPjwhLS1NRDU9WzNmZmZjMzQ3MzZkMmY3ZTc2OTU4ZGMzYzU5NmUzNTMxXQplbnRpdHkgc3BzLS0+PGcgaWQ9ImVsZW1fc3BzIj48cmVjdCBmaWxsPSIjOTk5OTk5IiBoZWlnaHQ9IjEzNi40MDYzIiByeD0iMi41IiByeT0iMi41IiBzdHlsZT0ic3Ryb2tlOiM4QThBOEE7c3Ryb2tlLXdpZHRoOjAuNTsiIHdpZHRoPSIyMDgiIHg9IjI2MSIgeT0iNTA5Ii8+PHRleHQgZmlsbD0iI0ZGRkZGRiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTYiIGZvbnQtd2VpZ2h0PSJib2xkIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjE3MiIgeD0iMjc5IiB5PSI1MzMuODUxNiI+U2NpZW5jZSBQcm9jZXNzaW5nPC90ZXh0Pjx0ZXh0IGZpbGw9IiNGRkZGRkYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjQiIHg9IjM2MyIgeT0iNTUwLjYyMDEiPsKgPC90ZXh0Pjx0ZXh0IGZpbGw9IiNGRkZGRkYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjEyNiIgeD0iMzAyIiB5PSI1NjYuOTE3Ij5TdWJzeXN0ZW0gZm9yIHRoZTwvdGV4dD48dGV4dCBmaWxsPSIjRkZGRkZGIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIxODQiIHg9IjI3MSIgeT0iNTgzLjIxMzkiPmdlbmVyYXRpb24gb2Ygc2NpZW5jZSBkYXRhPC90ZXh0Pjx0ZXh0IGZpbGw9IiNGRkZGRkYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjE0OCIgeD0iMjg5IiB5PSI1OTkuNTEwNyI+cHJvZHVjdHMgdGhyb3VnaCB0aGU8L3RleHQ+PHRleHQgZmlsbD0iI0ZGRkZGRiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iMTc5IiB4PSIyNzMuNSIgeT0iNjE1LjgwNzYiPmNvbWJpbmF0aW9uIG9mIEFsZ29yaXRobXM8L3RleHQ+PHRleHQgZmlsbD0iI0ZGRkZGRiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iNjIiIHg9IjMzNCIgeT0iNjMyLjEwNDUiPmFuZCBEYXRhPC90ZXh0PjwvZz48IS0tTUQ1PVs3MjdjMTA0MGFmOWJlMTg4YWIxN2QxOWM0OWY5YWMxMF0KZW50aXR5IGRzLS0+PGcgaWQ9ImVsZW1fZHMiPjxyZWN0IGZpbGw9IiM5OTk5OTkiIGhlaWdodD0iMTIwLjEwOTQiIHJ4PSIyLjUiIHJ5PSIyLjUiIHN0eWxlPSJzdHJva2U6IzhBOEE4QTtzdHJva2Utd2lkdGg6MC41OyIgd2lkdGg9IjIxOSIgeD0iMjIyLjUiIHk9IjczNiIvPjx0ZXh0IGZpbGw9IiNGRkZGRkYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE2IiBmb250LXdlaWdodD0iYm9sZCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIxMjIiIHg9IjI3MSIgeT0iNzYwLjg1MTYiPkRhdGEgU2VydmljZXM8L3RleHQ+PHRleHQgZmlsbD0iI0ZGRkZGRiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iNCIgeD0iMzMwIiB5PSI3NzcuNjIwMSI+wqA8L3RleHQ+PHRleHQgZmlsbD0iI0ZGRkZGRiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iMTcxIiB4PSIyNDYuNSIgeT0iNzkzLjkxNyI+U3Vic3lzdGVtIGZvciBpbmdlc3Rpb24sPC90ZXh0Pjx0ZXh0IGZpbGw9IiNGRkZGRkYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjE5MiIgeD0iMjM0IiB5PSI4MTAuMjEzOSI+c3RvcmFnZSwgYW5kIGFjY2VzcyB0byBkYXRhPC90ZXh0Pjx0ZXh0IGZpbGw9IiNGRkZGRkYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjE5NSIgeD0iMjMyLjUiIHk9IjgyNi41MTA3Ij5wcm9kdWN0cyBmb3IgdXNlIGluIHRoZSBVbml0eTwvdGV4dD48dGV4dCBmaWxsPSIjRkZGRkZGIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSI1NSIgeD0iMzA0LjUiIHk9Ijg0Mi44MDc2Ij5TeXN0ZW0uPC90ZXh0PjwvZz48IS0tTUQ1PVtkNTA5NjIzMGRlNWM3ZTliNWEzZDE5OTdiYTdmMzdmM10KZW50aXR5IGNzLS0+PGcgaWQ9ImVsZW1fY3MiPjxyZWN0IGZpbGw9IiM5OTk5OTkiIGhlaWdodD0iMTY5IiByeD0iMi41IiByeT0iMi41IiBzdHlsZT0ic3Ryb2tlOiM4QThBOEE7c3Ryb2tlLXdpZHRoOjAuNTsiIHdpZHRoPSIyMTkiIHg9IjI2Ni41IiB5PSI3Ii8+PHRleHQgZmlsbD0iI0ZGRkZGRiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTYiIGZvbnQtd2VpZ2h0PSJib2xkIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjE1OCIgeD0iMjk3IiB5PSIzMS44NTE2Ij5Db21tb24gU2VydmljZXM8L3RleHQ+PHRleHQgZmlsbD0iI0ZGRkZGRiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iNCIgeD0iMzc0IiB5PSI0OC42MjAxIj7CoDwvdGV4dD48dGV4dCBmaWxsPSIjRkZGRkZGIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIxNTIiIHg9IjMwMCIgeT0iNjQuOTE3Ij5QbGF0Zm9ybSB3aWRlIHRvb2wgYW5kPC90ZXh0Pjx0ZXh0IGZpbGw9IiNGRkZGRkYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjE4NiIgeD0iMjgxIiB5PSI4MS4yMTM5Ij5mdW5jdGlvbmFsIGltcGxlbWVudGF0aW9uczwvdGV4dD48dGV4dCBmaWxsPSIjRkZGRkZGIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIxOTUiIHg9IjI3Ni41IiB5PSI5Ny41MTA3Ij5pbmNsdWRpbmcgYXV0aGVudGljYXRpb24gYW5kPC90ZXh0Pjx0ZXh0IGZpbGw9IiNGRkZGRkYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjE0OSIgeD0iMjk5LjUiIHk9IjExMy44MDc2Ij5hdXRob3JpemF0aW9uLCBtZXRyaWNzPC90ZXh0Pjx0ZXh0IGZpbGw9IiNGRkZGRkYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjE5OSIgeD0iMjc2LjUiIHk9IjEzMC4xMDQ1Ij5wdWJsaWNhdGlvbiwgbG9nZ2luZyBzZXJ2aWNlcyw8L3RleHQ+PHRleHQgZmlsbD0iI0ZGRkZGRiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iMTQ5IiB4PSIyOTkuNSIgeT0iMTQ2LjQwMTQiPmRlcGxveW1lbnQgYW5kIGJ1aWxkPC90ZXh0Pjx0ZXh0IGZpbGw9IiNGRkZGRkYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjU4IiB4PSIzNDciIHk9IjE2Mi42OTgyIj5zeXN0ZW1zPC90ZXh0PjwvZz48IS0tTUQ1PVtkNGM0Y2EwYzY1MzlhYWQ4YjgwMjQ2YmQzNDY1Zjg1N10KZW50aXR5IGFkcy0tPjxnIGlkPSJlbGVtX2FkcyI+PHJlY3QgZmlsbD0iIzk5OTk5OSIgaGVpZ2h0PSIxMzguNzM0NCIgcng9IjIuNSIgcnk9IjIuNSIgc3R5bGU9InN0cm9rZTojOEE4QThBO3N0cm9rZS13aWR0aDowLjU7IiB3aWR0aD0iMjE1IiB4PSIxNi41IiB5PSIyMiIvPjx0ZXh0IGZpbGw9IiNGRkZGRkYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE2IiBmb250LXdlaWdodD0iYm9sZCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSI4NSIgeD0iNzguNSIgeT0iNDYuODUxNiI+QWxnb3JpdGhtPC90ZXh0Pjx0ZXh0IGZpbGw9IiNGRkZGRkYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE2IiBmb250LXdlaWdodD0iYm9sZCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIxMTciIHg9IjY1LjUiIHk9IjY1LjQ3NjYiPkRldmVsb3BtZW50PC90ZXh0Pjx0ZXh0IGZpbGw9IiNGRkZGRkYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjQiIHg9IjEyMiIgeT0iODIuMjQ1MSI+wqA8L3RleHQ+PHRleHQgZmlsbD0iI0ZGRkZGRiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iMTc5IiB4PSIzNC41IiB5PSI5OC41NDIiPlN1YnN5c3RlbSBmb3IgZGV2ZWxvcGluZzwvdGV4dD48dGV4dCBmaWxsPSIjRkZGRkZGIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIxNjciIHg9IjM4LjUiIHk9IjExNC44Mzg5Ij5hbmQgYXNzZW1ibGluZyBzY2llbmNlPC90ZXh0Pjx0ZXh0IGZpbGw9IiNGRkZGRkYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjE5MSIgeD0iMjYuNSIgeT0iMTMxLjEzNTciPmFsZ29yaXRobXMgaW50byBhbiBhbGdvcml0aG08L3RleHQ+PHRleHQgZmlsbD0iI0ZGRkZGRiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iNTAiIHg9Ijk5IiB5PSIxNDcuNDMyNiI+Y2F0YWxvZzwvdGV4dD48L2c+PCEtLU1ENT1bNGNiMDU3MTAzNDBhZjM1OWRlMmI5ZDg0MmVlZmQzNDhdCmxpbmsgdHJuc2ZybSB0byBhb2RzLS0+PGcgaWQ9ImxpbmtfdHJuc2ZybV9hb2RzIj48cGF0aCBkPSJNMTI0LDQyMC4xNyBDMTI0LDQ0NC4zNiAxMjQsNDczLjc0IDEyNCw1MDAuNDMgIiBmaWxsPSJub25lIiBpZD0idHJuc2ZybS10by1hb2RzIiBzdHlsZT0ic3Ryb2tlOiM2NjY2NjY7c3Ryb2tlLXdpZHRoOjEuMDsiLz48cG9seWdvbiBmaWxsPSIjNjY2NjY2IiBwb2ludHM9IjEyNCw1MDguNjIsMTI3LDUwMC42MiwxMjEsNTAwLjYyLDEyNCw1MDguNjIiIHN0eWxlPSJzdHJva2U6IzY2NjY2NjtzdHJva2Utd2lkdGg6MS4wOyIvPjx0ZXh0IGZpbGw9IiM2NjY2NjYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iYm9sZCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIxNDQiIHg9IjEyNSIgeT0iNDY5LjEzODciPlJldHJpZXZlcyBEYXRhIEZyb208L3RleHQ+PC9nPjwhLS1NRDU9WzJkY2NkNjU2YzE0OGZjOTQ0MTk5NWE5MzA4Y2YwZjNjXQpsaW5rIGFvZHMgdG8gZHMtLT48ZyBpZD0ibGlua19hb2RzX2RzIj48cGF0aCBkPSJNMTg4LjM5LDY0NS4xNyBDMjE0LjIzLDY3Mi4xNCAyNDMuOTIsNzAzLjEgMjY5LjU2LDcyOS44NiAiIGZpbGw9Im5vbmUiIGlkPSJhb2RzLXRvLWRzIiBzdHlsZT0ic3Ryb2tlOiM2NjY2NjY7c3Ryb2tlLXdpZHRoOjEuMDsiLz48cG9seWdvbiBmaWxsPSIjNjY2NjY2IiBwb2ludHM9IjI3NS4zMSw3MzUuODUsMjcxLjkzMjMsNzI4LjAwMiwyNjcuNjA0OCw3MzIuMTU4MSwyNzUuMzEsNzM1Ljg1IiBzdHlsZT0ic3Ryb2tlOiM2NjY2NjY7c3Ryb2tlLXdpZHRoOjEuMDsiLz48dGV4dCBmaWxsPSIjNjY2NjY2IiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMiIgZm9udC13ZWlnaHQ9ImJvbGQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iMTAwIiB4PSIyNTguNSIgeT0iNjg5LjEzODciPm9wdGltaXplcyBhbmQ8L3RleHQ+PHRleHQgZmlsbD0iIzY2NjY2NiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTIiIGZvbnQtd2VpZ2h0PSJib2xkIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjEyNyIgeD0iMjQ3IiB5PSI3MDMuMTA3NCI+c3RvcmVzcyBkYXRhIGZyb208L3RleHQ+PC9nPjwhLS1NRDU9WzgyZjMyM2E1MmMxNmE0MjY3NWU2ZDg3NGI2MWYzNDc4XQpsaW5rIHRybnNmcm0gdG8gZHMtLT48ZyBpZD0ibGlua190cm5zZnJtX2RzIj48cGF0aCBkPSJNMjI1LjMzLDM4My4wMyBDMzExLjQzLDM5Ni43NiA0MjYuNTQsNDE5Ljk3IDQ2Miw0NTAgQzUzNi43Niw1MTMuMzEgNTI5LjA5LDU4MC41NCA0ODcsNjY5IEM0NzUuNzksNjkyLjU1IDQ1Ny43OSw3MTMuMTUgNDM3Ljk1LDczMC40OCAiIGZpbGw9Im5vbmUiIGlkPSJ0cm5zZnJtLXRvLWRzIiBzdHlsZT0ic3Ryb2tlOiM2NjY2NjY7c3Ryb2tlLXdpZHRoOjEuMDsiLz48cG9seWdvbiBmaWxsPSIjNjY2NjY2IiBwb2ludHM9IjQzMS43NCw3MzUuNzYsNDM5Ljc4MjIsNzMyLjg3NSw0MzUuOTAyMiw3MjguMjk4NCw0MzEuNzQsNzM1Ljc2IiBzdHlsZT0ic3Ryb2tlOiM2NjY2NjY7c3Ryb2tlLXdpZHRoOjEuMDsiLz48dGV4dCBmaWxsPSIjNjY2NjY2IiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMiIgZm9udC13ZWlnaHQ9ImJvbGQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iMTQ0IiB4PSI1MTkiIHk9IjU4MS42Mzg3Ij5SZXRyaWV2ZXMgRGF0YSBGcm9tPC90ZXh0PjwvZz48IS0tTUQ1PVs4ODMwNDM5YTA1OWZiM2ViNzk1ZjFhYTJiNzljZDVhYl0KbGluayB0cm5zZnJtIHRvIHNwcy0tPjxnIGlkPSJsaW5rX3RybnNmcm1fc3BzIj48cGF0aCBkPSJNMjI1LjEsNDEzLjE2IEMyNDMuNzYsNDIzLjc0IDI2Mi4yOSw0MzYuMDcgMjc4LDQ1MCBDMjk0Ljc0LDQ2NC44NCAzMDkuODgsNDgzLjU0IDMyMi42Niw1MDEuOTYgIiBmaWxsPSJub25lIiBpZD0idHJuc2ZybS10by1zcHMiIHN0eWxlPSJzdHJva2U6IzY2NjY2NjtzdHJva2Utd2lkdGg6MS4wOyIvPjxwb2x5Z29uIGZpbGw9IiM2NjY2NjYiIHBvaW50cz0iMzI3LjI2LDUwOC43MywzMjUuMjQwMyw1MDAuNDI4MSwzMjAuMjc5Niw1MDMuODAzMiwzMjcuMjYsNTA4LjczIiBzdHlsZT0ic3Ryb2tlOiM2NjY2NjY7c3Ryb2tlLXdpZHRoOjEuMDsiLz48dGV4dCBmaWxsPSIjNjY2NjY2IiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMiIgZm9udC13ZWlnaHQ9ImJvbGQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iMTQ5IiB4PSIzMDQiIHk9IjQ2Mi4xMzg3Ij5SZXF1ZXN0cyBsYXJnZSBzY2FsZTwvdGV4dD48dGV4dCBmaWxsPSIjNjY2NjY2IiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMiIgZm9udC13ZWlnaHQ9ImJvbGQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iMTE0IiB4PSIzMjEuNSIgeT0iNDc2LjEwNzQiPnByb2Nlc3NpbmcgZnJvbTwvdGV4dD48L2c+PCEtLU1ENT1bMDk4N2ViMDJiOTk4MjdiYTkxOTg0NDczYjJhNzdiY2RdCmxpbmsgYWRzIHRvIHRybnNmcm0tLT48ZyBpZD0ibGlua19hZHNfdHJuc2ZybSI+PHBhdGggZD0iTTEyNCwxNjEuMDYgQzEyNCwyMDYuMTEgMTI0LDI2NC40NyAxMjQsMzA3LjU2ICIgZmlsbD0ibm9uZSIgaWQ9ImFkcy10by10cm5zZnJtIiBzdHlsZT0ic3Ryb2tlOiM2NjY2NjY7c3Ryb2tlLXdpZHRoOjEuMDsiLz48cG9seWdvbiBmaWxsPSIjNjY2NjY2IiBwb2ludHM9IjEyNCwzMTUuNjksMTI3LDMwNy42OSwxMjEsMzA3LjY5LDEyNCwzMTUuNjkiIHN0eWxlPSJzdHJva2U6IzY2NjY2NjtzdHJva2Utd2lkdGg6MS4wOyIvPjx0ZXh0IGZpbGw9IiM2NjY2NjYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iYm9sZCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSI2NyIgeD0iMTU0IiB5PSIyMTguMTM4NyI+UmVxdWVzdHM8L3RleHQ+PHRleHQgZmlsbD0iIzY2NjY2NiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTIiIGZvbnQtd2VpZ2h0PSJib2xkIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjEyNSIgeD0iMTI1IiB5PSIyMzIuMTA3NCI+dHJhbnNmb3JtZWQgZGF0YTwvdGV4dD48dGV4dCBmaWxsPSIjNjY2NjY2IiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMiIgZm9udC13ZWlnaHQ9ImJvbGQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iMzIiIHg9IjE3My41IiB5PSIyNDYuMDc2MiI+ZnJvbTwvdGV4dD48L2c+PHJlY3QgaGVpZ2h0PSIxNjIuNjcxOSIgcng9IjcuNSIgcnk9IjcuNSIgc3R5bGU9InN0cm9rZTojMDAwMDAwMDA7c3Ryb2tlLXdpZHRoOjEuMDtmaWxsOm5vbmU7IiB3aWR0aD0iMTU5IiB4PSI0OTAiIHk9Ijg2OS4xMDk0Ii8+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGZvbnQtd2VpZ2h0PSJib2xkIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjU5IiB4PSI0OTYiIHk9Ijg5MC4xMDQ1Ij5MZWdlbmQ8L3RleHQ+PHRleHQgZmlsbD0iI0ZGRkZGRiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iNCIgeD0iNTU1IiB5PSI4OTAuMTA0NSI+wqA8L3RleHQ+PHJlY3QgZmlsbD0iIzA4NDI3QiIgaGVpZ2h0PSIxNi4yOTY5IiBzdHlsZT0ic3Ryb2tlOm5vbmU7c3Ryb2tlLXdpZHRoOjEuMDsiIHdpZHRoPSIxNDciIHg9IjQ5NiIgeT0iODkzLjQwNjMiLz48dGV4dCBmaWxsPSIjRkZGRkZGIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSI0OSIgeD0iNTAwIiB5PSI5MDYuNDAxNCI+cGVyc29uPC90ZXh0PjxyZWN0IGZpbGw9IiMxMTY4QkQiIGhlaWdodD0iMTYuMjk2OSIgc3R5bGU9InN0cm9rZTpub25lO3N0cm9rZS13aWR0aDoxLjA7IiB3aWR0aD0iMTQ3IiB4PSI0OTYiIHk9IjkwOS43MDMxIi8+PHRleHQgZmlsbD0iI0ZGRkZGRiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iNTAiIHg9IjUwMCIgeT0iOTIyLjY5ODIiPnN5c3RlbTwvdGV4dD48cmVjdCBmaWxsPSIjNDM4REQ1IiBoZWlnaHQ9IjE2LjI5NjkiIHN0eWxlPSJzdHJva2U6bm9uZTtzdHJva2Utd2lkdGg6MS4wOyIgd2lkdGg9IjE0NyIgeD0iNDk2IiB5PSI5MjYiLz48dGV4dCBmaWxsPSIjRkZGRkZGIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSI2NSIgeD0iNTAwIiB5PSI5MzguOTk1MSI+Y29udGFpbmVyPC90ZXh0PjxyZWN0IGZpbGw9IiM4NUJCRjAiIGhlaWdodD0iMTYuMjk2OSIgc3R5bGU9InN0cm9rZTpub25lO3N0cm9rZS13aWR0aDoxLjA7IiB3aWR0aD0iMTQ3IiB4PSI0OTYiIHk9Ijk0Mi4yOTY5Ii8+PHRleHQgZmlsbD0iI0ZGRkZGRiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iODAiIHg9IjUwMCIgeT0iOTU1LjI5MiI+Y29tcG9uZW50PC90ZXh0PjxyZWN0IGZpbGw9IiM2ODY4NjgiIGhlaWdodD0iMTYuMjk2OSIgc3R5bGU9InN0cm9rZTpub25lO3N0cm9rZS13aWR0aDoxLjA7IiB3aWR0aD0iMTQ3IiB4PSI0OTYiIHk9Ijk1OC41OTM4Ii8+PHRleHQgZmlsbD0iI0ZGRkZGRiIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iMTA4IiB4PSI1MDAiIHk9Ijk3MS41ODg5Ij5leHRlcm5hbCBwZXJzb248L3RleHQ+PHJlY3QgZmlsbD0iIzk5OTk5OSIgaGVpZ2h0PSIxNi4yOTY5IiBzdHlsZT0ic3Ryb2tlOm5vbmU7c3Ryb2tlLXdpZHRoOjEuMDsiIHdpZHRoPSIxNDciIHg9IjQ5NiIgeT0iOTc0Ljg5MDYiLz48dGV4dCBmaWxsPSIjRkZGRkZGIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIxMDkiIHg9IjUwMCIgeT0iOTg3Ljg4NTciPmV4dGVybmFsIHN5c3RlbTwvdGV4dD48cmVjdCBmaWxsPSIjQjNCM0IzIiBoZWlnaHQ9IjE2LjI5NjkiIHN0eWxlPSJzdHJva2U6bm9uZTtzdHJva2Utd2lkdGg6MS4wOyIgd2lkdGg9IjE0NyIgeD0iNDk2IiB5PSI5OTEuMTg3NSIvPjx0ZXh0IGZpbGw9IiNGRkZGRkYiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjEyNCIgeD0iNTAwIiB5PSIxMDA0LjE4MjYiPmV4dGVybmFsIGNvbnRhaW5lcjwvdGV4dD48cmVjdCBmaWxsPSIjQ0NDQ0NDIiBoZWlnaHQ9IjE2LjI5NjkiIHN0eWxlPSJzdHJva2U6bm9uZTtzdHJva2Utd2lkdGg6MS4wOyIgd2lkdGg9IjE0NyIgeD0iNDk2IiB5PSIxMDA3LjQ4NDQiLz48dGV4dCBmaWxsPSIjRkZGRkZGIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIxMzkiIHg9IjUwMCIgeT0iMTAyMC40Nzk1Ij5leHRlcm5hbCBjb21wb25lbnQ8L3RleHQ+PGxpbmUgc3R5bGU9InN0cm9rZTojRkZGRkZGO3N0cm9rZS13aWR0aDoxLjA7IiB4MT0iNDk2IiB4Mj0iNjQzIiB5MT0iODc3LjEwOTQiIHkyPSI4NzcuMTA5NCIvPjxsaW5lIHN0eWxlPSJzdHJva2U6I0ZGRkZGRjtzdHJva2Utd2lkdGg6MS4wOyIgeDE9IjQ5NiIgeDI9IjY0MyIgeTE9Ijg5My40MDYzIiB5Mj0iODkzLjQwNjMiLz48bGluZSBzdHlsZT0ic3Ryb2tlOiNGRkZGRkY7c3Ryb2tlLXdpZHRoOjEuMDsiIHgxPSI0OTYiIHgyPSI2NDMiIHkxPSI5MDkuNzAzMSIgeTI9IjkwOS43MDMxIi8+PGxpbmUgc3R5bGU9InN0cm9rZTojRkZGRkZGO3N0cm9rZS13aWR0aDoxLjA7IiB4MT0iNDk2IiB4Mj0iNjQzIiB5MT0iOTI2IiB5Mj0iOTI2Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTojRkZGRkZGO3N0cm9rZS13aWR0aDoxLjA7IiB4MT0iNDk2IiB4Mj0iNjQzIiB5MT0iOTQyLjI5NjkiIHkyPSI5NDIuMjk2OSIvPjxsaW5lIHN0eWxlPSJzdHJva2U6I0ZGRkZGRjtzdHJva2Utd2lkdGg6MS4wOyIgeDE9IjQ5NiIgeDI9IjY0MyIgeTE9Ijk1OC41OTM4IiB5Mj0iOTU4LjU5MzgiLz48bGluZSBzdHlsZT0ic3Ryb2tlOiNGRkZGRkY7c3Ryb2tlLXdpZHRoOjEuMDsiIHgxPSI0OTYiIHgyPSI2NDMiIHkxPSI5NzQuODkwNiIgeTI9Ijk3NC44OTA2Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTojRkZGRkZGO3N0cm9rZS13aWR0aDoxLjA7IiB4MT0iNDk2IiB4Mj0iNjQzIiB5MT0iOTkxLjE4NzUiIHkyPSI5OTEuMTg3NSIvPjxsaW5lIHN0eWxlPSJzdHJva2U6I0ZGRkZGRjtzdHJva2Utd2lkdGg6MS4wOyIgeDE9IjQ5NiIgeDI9IjY0MyIgeTE9IjEwMDcuNDg0NCIgeTI9IjEwMDcuNDg0NCIvPjxsaW5lIHN0eWxlPSJzdHJva2U6I0ZGRkZGRjtzdHJva2Utd2lkdGg6MS4wOyIgeDE9IjQ5NiIgeDI9IjY0MyIgeTE9IjEwMjMuNzgxMyIgeTI9IjEwMjMuNzgxMyIvPjxsaW5lIHN0eWxlPSJzdHJva2U6I0ZGRkZGRjtzdHJva2Utd2lkdGg6MS4wOyIgeDE9IjQ5NiIgeDI9IjQ5NiIgeTE9Ijg3Ny4xMDk0IiB5Mj0iMTAyMy43ODEzIi8+PGxpbmUgc3R5bGU9InN0cm9rZTojRkZGRkZGO3N0cm9rZS13aWR0aDoxLjA7IiB4MT0iNjQzIiB4Mj0iNjQzIiB5MT0iODc3LjEwOTQiIHkyPSIxMDIzLjc4MTMiLz48IS0tTUQ1PVs1YWE2ZWM1ODMyYmZlODViNTgzZjdlNmFkNjVjYTUxNF0KQHN0YXJ0dW1sDQohaW5jbHVkZSBodHRwczovL3Jhdy5naXRodWJ1c2VyY29udGVudC5jb20vYWRyaWFudmx1cHUvQzQtUGxhbnRVTUwvbGF0ZXN0L0M0X0NvbXBvbmVudC5wdW1sDQoNCidHbG9iYWwgdmFycyByZXBlYXRlZCBmb3IgcmVmZXJlbmNpbmcgb3RoZXIgY29tbW9uIHN5c3RlbXMNCiFnbG9iYWwgJFVTQ19ERVNDID0gIlBsYXRmb3JtIHdpZGUgdG9vbCBhbmQgZnVuY3Rpb25hbCBpbXBsZW1lbnRhdGlvbnMgaW5jbHVkaW5nIGF1dGhlbnRpY2F0aW9uIGFuZCBhdXRob3JpemF0aW9uLCBtZXRyaWNzIHB1YmxpY2F0aW9uLCBsb2dnaW5nIHNlcnZpY2VzLCBkZXBsb3ltZW50IGFuZCBidWlsZCBzeXN0ZW1zIg0KIWdsb2JhbCAkQVNfREVTQyA9ICJIaWdoZXIgbGV2ZWwgZGF0YSBmdW5jdGlvbnMgdG8gYWNjZXNzIGFuZCB0cmFuc2Zvcm0gZGF0YS4iDQohZ2xvYmFsICRBRFNfREVTQyA9ICJTdWJzeXN0ZW0gZm9yIGRldmVsb3BpbmcgYW5kIGFzc2VtYmxpbmcgc2NpZW5jZSBhbGdvcml0aG1zIGludG8gYW4gYWxnb3JpdGhtIGNhdGFsb2ciDQohZ2xvYmFsICRTUFNfREVTQyA9ICJTdWJzeXN0ZW0gZm9yIHRoZSBnZW5lcmF0aW9uIG9mIHNjaWVuY2UgZGF0YSBwcm9kdWN0cyB0aHJvdWdoIHRoZSBjb21iaW5hdGlvbiBvZiBBbGdvcml0aG1zIGFuZCBEYXRhIg0KIWdsb2JhbCAkRFNfREVTQyA9ICJTdWJzeXN0ZW0gZm9yIGluZ2VzdGlvbiwgc3RvcmFnZSwgYW5kIGFjY2VzcyB0byBkYXRhIHByb2R1Y3RzIGZvciB1c2UgaW4gdGhlIFVuaXR5IFN5c3RlbS4iDQoNCkxBWU9VVF9XSVRIX0xFR0VORCgpDQoNCidHbG9iYWwgJ2V4dGVybmFsIHN5c3RlbXMnIGRlZmluaXRpb25zDQoNClN5c3RlbV9FeHQoc3BzLCAiU2NpZW5jZSBQcm9jZXNzaW5nIiwgJFNQU19ERVNDKQ0KU3lzdGVtX0V4dChkcywgIkRhdGEgU2VydmljZXMiLCAkRFNfREVTQykNCidTeXN0ZW1fRXh0KGFzLCAiQW5hbHlzaXMgU2VydmljZXMiLCAkQVNfREVTQykNClN5c3RlbV9FeHQoY3MsICJDb21tb24gU2VydmljZXMiLCAkVVNDX0RFU0MpDQpTeXN0ZW1fRXh0KGFkcywgIkFsZ29yaXRobSBEZXZlbG9wbWVudCIsICRBRFNfREVTQykNCg0KDQpTeXN0ZW1fQm91bmRhcnkoYXMsICJhbmFseXNpcyBTZXJ2aWNlcyIpIHsNCiAgICBDb250YWluZXIodHJuc2ZybSwgIlRyYW5zZm9ybWF0aW9uIFNlcnZpY2UiLCAiV0NTLCBXQ1BTIiwgIlRyYW5zZm9ybXMgZGF0YSBwcm9kdWN0cyIpDQogICAgQ29udGFpbmVyKGFvZHMsICJBbmFseXNpcyBPcHRpbWl6ZWQgRGF0YSBTdG9yZXMgKEFPRFMpIiwiIiwgIlN0b3JhZ2Ugb2Ygbm9uLW9wdGltaXplZCBkYXRhIGluIGFuYWx5c2lzIG9wdGltaXplZCBmb3JtYXRzIikNCg0KICAgIFJlbCh0cm5zZnJtLCBhb2RzLCAiUmV0cmlldmVzIERhdGEgRnJvbSIpDQp9DQoNClJlbChhb2RzLCBkcywgIm9wdGltaXplcyBhbmQgc3RvcmVzcyBkYXRhIGZyb20iKQ0KUmVsKHRybnNmcm0sIGRzLCAiUmV0cmlldmVzIERhdGEgRnJvbSIpDQpSZWwodHJuc2ZybSwgc3BzLCAiUmVxdWVzdHMgbGFyZ2Ugc2NhbGUgcHJvY2Vzc2luZyBmcm9tIikNCg0KUmVsKGFkcyx0cm5zZnJtLCAiUmVxdWVzdHMgdHJhbnNmb3JtZWQgZGF0YSBmcm9tIikNCg0KQGVuZHVtbA0KCkBzdGFydHVtbA0KDQoNCg0KDQoNCnNraW5wYXJhbSBkZWZhdWx0VGV4dEFsaWdubWVudCBjZW50ZXINCg0Kc2tpbnBhcmFtIHdyYXBXaWR0aCAyMDANCnNraW5wYXJhbSBtYXhNZXNzYWdlU2l6ZSAxNTANCg0Kc2tpbnBhcmFtIExlZ2VuZEJvcmRlckNvbG9yIHRyYW5zcGFyZW50DQpza2lucGFyYW0gTGVnZW5kQmFja2dyb3VuZENvbG9yIHRyYW5zcGFyZW50DQpza2lucGFyYW0gTGVnZW5kRm9udENvbG9yICNGRkZGRkYNCg0Kc2tpbnBhcmFtIHJlY3RhbmdsZSB7DQogICAgU3RlcmVvdHlwZUZvbnRTaXplIDEyDQogICAgc2hhZG93aW5nIGZhbHNlDQp9DQoNCnNraW5wYXJhbSBkYXRhYmFzZSB7DQogICAgU3RlcmVvdHlwZUZvbnRTaXplIDEyDQogICAgc2hhZG93aW5nIGZhbHNlDQp9DQoNCnNraW5wYXJhbSBxdWV1ZSB7DQogICAgU3RlcmVvdHlwZUZvbnRTaXplIDEyDQogICAgc2hhZG93aW5nIGZhbHNlDQp9DQoNCnNraW5wYXJhbSBBcnJvdyB7DQogICAgQ29sb3IgIzY2NjY2Ng0KICAgIEZvbnRDb2xvciAjNjY2NjY2DQogICAgRm9udFNpemUgMTINCn0NCg0Kc2tpbnBhcmFtIHJlY3RhbmdsZTw8Ym91bmRhcnk+PiB7DQogICAgU2hhZG93aW5nIGZhbHNlDQogICAgU3RlcmVvdHlwZUZvbnRTaXplIDANCiAgICBGb250Q29sb3IgIzQ0NDQ0NA0KICAgIEJvcmRlckNvbG9yICM0NDQ0NDQNCiAgICBCb3JkZXJTdHlsZSBkYXNoZWQNCn0NCg0KDQoNCg0KDQoNCg0KDQoNCg0KDQoNCg0KDQoNCg0KDQoNCg0KDQoNCg0KDQoNCg0KDQoNCg0KDQpza2lucGFyYW0gcmVjdGFuZ2xlPDxwZXJzb24+PiB7DQogICAgU3RlcmVvdHlwZUZvbnRDb2xvciAjRkZGRkZGDQogICAgRm9udENvbG9yICNGRkZGRkYNCiAgICBCYWNrZ3JvdW5kQ29sb3IgIzA4NDI3Qg0KICAgIEJvcmRlckNvbG9yICMwNzNCNkYNCn0NCg0Kc2tpbnBhcmFtIHJlY3RhbmdsZTw8ZXh0ZXJuYWxfcGVyc29uPj4gew0KICAgIFN0ZXJlb3R5cGVGb250Q29sb3IgI0ZGRkZGRg0KICAgIEZvbnRDb2xvciAjRkZGRkZGDQogICAgQmFja2dyb3VuZENvbG9yICM2ODY4NjgNCiAgICBCb3JkZXJDb2xvciAjOEE4QThBDQp9DQoNCnNraW5wYXJhbSByZWN0YW5nbGU8PHN5c3RlbT4+IHsNCiAgICBTdGVyZW90eXBlRm9udENvbG9yICNGRkZGRkYNCiAgICBGb250Q29sb3IgI0ZGRkZGRg0KICAgIEJhY2tncm91bmRDb2xvciAjMTE2OEJEDQogICAgQm9yZGVyQ29sb3IgIzNDN0ZDMA0KfQ0KDQpza2lucGFyYW0gcmVjdGFuZ2xlPDxleHRlcm5hbF9zeXN0ZW0+PiB7DQogICAgU3RlcmVvdHlwZUZvbnRDb2xvciAjRkZGRkZGDQogICAgRm9udENvbG9yICNGRkZGRkYNCiAgICBCYWNrZ3JvdW5kQ29sb3IgIzk5OTk5OQ0KICAgIEJvcmRlckNvbG9yICM4QThBOEENCn0NCg0Kc3ByaXRlICRwZXJzb24gWzQ4eDQ4LzE2XSB7DQowMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMDAwMDAwMDA0OUJDQ0E3MjAwMDAwMDAwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDAwMDAwMDA2RUZGRkZGRkZGQjMwMDAwMDAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwMDAwMDAxQ0ZGRkZGRkZGRkZGRjcwMDAwMDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMDAwMUVGRkZGRkZGRkZGRkZGRjgwMDAwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDAwMDBDRkZGRkZGRkZGRkZGRkZGRjYwMDAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwMDAwN0ZGRkZGRkZGRkZGRkZGRkZGRjEwMDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMDFGRkZGRkZGRkZGRkZGRkZGRkZGOTAwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDAwNkZGRkZGRkZGRkZGRkZGRkZGRkZGMDAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwMDBCRkZGRkZGRkZGRkZGRkZGRkZGRkY0MDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMEVGRkZGRkZGRkZGRkZGRkZGRkZGRjcwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDAwRkZGRkZGRkZGRkZGRkZGRkZGRkZGODAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwMDBGRkZGRkZGRkZGRkZGRkZGRkZGRkY4MDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMERGRkZGRkZGRkZGRkZGRkZGRkZGRjYwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDAwQUZGRkZGRkZGRkZGRkZGRkZGRkZGNDAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwMDA2RkZGRkZGRkZGRkZGRkZGRkZGRkUwMDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMDBFRkZGRkZGRkZGRkZGRkZGRkZGODAwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDAwMDdGRkZGRkZGRkZGRkZGRkZGRkYxMDAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwMDAwMEJGRkZGRkZGRkZGRkZGRkZGNTAwMDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMDAwMURGRkZGRkZGRkZGRkZGRjcwMDAwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDAwMDAwMEJGRkZGRkZGRkZGRkY1MDAwMDAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwMDAwMDAwMDVERkZGRkZGRkZBMTAwMDAwMDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMDAwMDAwMDAzN0FCQjk2MTAwMDAwMDAwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMDI1Nzg4MzAwMDAwMDAwMDA1ODg2NDEwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDdERkZGRkZGRDk2NDMzNDdCRkZGRkZGRkI0MDAwMDAwMDAwMDANCjAwMDAwMDAwMDRFRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZCMTAwMDAwMDAwMA0KMDAwMDAwMDA3RkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZEMjAwMDAwMDAwDQowMDAwMDAwNkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZFMTAwMDAwMDANCjAwMDAwMDNGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZCMDAwMDAwMA0KMDAwMDAwQkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkY1MDAwMDAwDQowMDAwMDNGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkQwMDAwMDANCjAwMDAwOUZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRjIwMDAwMA0KMDAwMDBERkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGNjAwMDAwDQowMDAwMEZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkY4MDAwMDANCjAwMDAxRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkEwMDAwMA0KMDAwMDFGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGQjAwMDAwDQowMDAwMUZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZCMDAwMDANCjAwMDAxRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkIwMDAwMA0KMDAwMDFGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGQTAwMDAwDQowMDAwMEVGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkY3MDAwMDANCjAwMDAwNkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRTEwMDAwMA0KMDAwMDAwOEZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkQzMDAwMDAwDQowMDAwMDAwMTQ1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTUzMDAwMDAwMDANCjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwDQp9DQoNCg0KDQoNCg0KDQoNCg0KDQoNCg0KDQoNCg0KDQoNCnNraW5wYXJhbSByZWN0YW5nbGU8PGNvbnRhaW5lcj4+IHsNCiAgICBTdGVyZW90eXBlRm9udENvbG9yICNGRkZGRkYNCiAgICBGb250Q29sb3IgI0ZGRkZGRg0KICAgIEJhY2tncm91bmRDb2xvciAjNDM4REQ1DQogICAgQm9yZGVyQ29sb3IgIzNDN0ZDMA0KfQ0KDQpza2lucGFyYW0gZGF0YWJhc2U8PGNvbnRhaW5lcj4+IHsNCiAgICBTdGVyZW90eXBlRm9udENvbG9yICNGRkZGRkYNCiAgICBGb250Q29sb3IgI0ZGRkZGRg0KICAgIEJhY2tncm91bmRDb2xvciAjNDM4REQ1DQogICAgQm9yZGVyQ29sb3IgIzNDN0ZDMA0KfQ0KDQpza2lucGFyYW0gcXVldWU8PGNvbnRhaW5lcj4+IHsNCiAgICBTdGVyZW90eXBlRm9udENvbG9yICNGRkZGRkYNCiAgICBGb250Q29sb3IgI0ZGRkZGRg0KICAgIEJhY2tncm91bmRDb2xvciAjNDM4REQ1DQogICAgQm9yZGVyQ29sb3IgIzNDN0ZDMA0KfQ0KDQpza2lucGFyYW0gcmVjdGFuZ2xlPDxleHRlcm5hbF9jb250YWluZXI+PiB7DQogICAgU3RlcmVvdHlwZUZvbnRDb2xvciAjRkZGRkZGDQogICAgRm9udENvbG9yICNGRkZGRkYNCiAgICBCYWNrZ3JvdW5kQ29sb3IgI0IzQjNCMw0KICAgIEJvcmRlckNvbG9yICNBNkE2QTYNCn0NCg0Kc2tpbnBhcmFtIGRhdGFiYXNlPDxleHRlcm5hbF9jb250YWluZXI+PiB7DQogICAgU3RlcmVvdHlwZUZvbnRDb2xvciAjRkZGRkZGDQogICAgRm9udENvbG9yICNGRkZGRkYNCiAgICBCYWNrZ3JvdW5kQ29sb3IgI0IzQjNCMw0KICAgIEJvcmRlckNvbG9yICNBNkE2QTYNCn0NCg0Kc2tpbnBhcmFtIHF1ZXVlPDxleHRlcm5hbF9jb250YWluZXI+PiB7DQogICAgU3RlcmVvdHlwZUZvbnRDb2xvciAjRkZGRkZGDQogICAgRm9udENvbG9yICNGRkZGRkYNCiAgICBCYWNrZ3JvdW5kQ29sb3IgI0IzQjNCMw0KICAgIEJvcmRlckNvbG9yICNBNkE2QTYNCn0NCg0KDQoNCg0KDQoNCg0KDQoNCg0KDQoNCg0KDQoNCg0KDQpza2lucGFyYW0gcmVjdGFuZ2xlPDxjb21wb25lbnQ+PiB7DQogICAgU3RlcmVvdHlwZUZvbnRDb2xvciAjMDAwMDAwDQogICAgRm9udENvbG9yICMwMDAwMDANCiAgICBCYWNrZ3JvdW5kQ29sb3IgIzg1QkJGMA0KICAgIEJvcmRlckNvbG9yICM3OEE4RDgNCn0NCg0Kc2tpbnBhcmFtIGRhdGFiYXNlPDxjb21wb25lbnQ+PiB7DQogICAgU3RlcmVvdHlwZUZvbnRDb2xvciAjMDAwMDAwDQogICAgRm9udENvbG9yICMwMDAwMDANCiAgICBCYWNrZ3JvdW5kQ29sb3IgIzg1QkJGMA0KICAgIEJvcmRlckNvbG9yICM3OEE4RDgNCn0NCg0Kc2tpbnBhcmFtIHF1ZXVlPDxjb21wb25lbnQ+PiB7DQogICAgU3RlcmVvdHlwZUZvbnRDb2xvciAjMDAwMDAwDQogICAgRm9udENvbG9yICMwMDAwMDANCiAgICBCYWNrZ3JvdW5kQ29sb3IgIzg1QkJGMA0KICAgIEJvcmRlckNvbG9yICM3OEE4RDgNCn0NCg0Kc2tpbnBhcmFtIHJlY3RhbmdsZTw8ZXh0ZXJuYWxfY29tcG9uZW50Pj4gew0KICAgIFN0ZXJlb3R5cGVGb250Q29sb3IgIzAwMDAwMA0KICAgIEZvbnRDb2xvciAjMDAwMDAwDQogICAgQmFja2dyb3VuZENvbG9yICNDQ0NDQ0MNCiAgICBCb3JkZXJDb2xvciAjQkZCRkJGDQp9DQoNCnNraW5wYXJhbSBkYXRhYmFzZTw8ZXh0ZXJuYWxfY29tcG9uZW50Pj4gew0KICAgIFN0ZXJlb3R5cGVGb250Q29sb3IgIzAwMDAwMA0KICAgIEZvbnRDb2xvciAjMDAwMDAwDQogICAgQmFja2dyb3VuZENvbG9yICNDQ0NDQ0MNCiAgICBCb3JkZXJDb2xvciAjQkZCRkJGDQp9DQoNCnNraW5wYXJhbSBxdWV1ZTw8ZXh0ZXJuYWxfY29tcG9uZW50Pj4gew0KICAgIFN0ZXJlb3R5cGVGb250Q29sb3IgIzAwMDAwMA0KICAgIEZvbnRDb2xvciAjMDAwMDAwDQogICAgQmFja2dyb3VuZENvbG9yICNDQ0NDQ0MNCiAgICBCb3JkZXJDb2xvciAjQkZCRkJGDQp9DQoNCg0KDQoNCg0KDQoNCg0KDQoNCg0KDQpoaWRlIHN0ZXJlb3R5cGUNCmxlZ2VuZCByaWdodA0KfDxjb2xvcjojMDAwMDAwPioqTGVnZW5kKio8L2NvbG9yPiB8DQp8PCMwODQyN0I+IHBlcnNvbiB8DQp8PCMxMTY4QkQ+IHN5c3RlbSB8DQp8PCM0MzhERDU+IGNvbnRhaW5lciB8DQp8PCM4NUJCRjA+IGNvbXBvbmVudCB8DQp8PCM2ODY4Njg+IGV4dGVybmFsIHBlcnNvbiB8DQp8PCM5OTk5OTk+IGV4dGVybmFsIHN5c3RlbSB8DQp8PCNCM0IzQjM+IGV4dGVybmFsIGNvbnRhaW5lciB8DQp8PCNDQ0NDQ0M+IGV4dGVybmFsIGNvbXBvbmVudCB8DQplbmRsZWdlbmQNCg0KDQpyZWN0YW5nbGUgIj09U2NpZW5jZSBQcm9jZXNzaW5nXG5cbiBTdWJzeXN0ZW0gZm9yIHRoZSBnZW5lcmF0aW9uIG9mIHNjaWVuY2UgZGF0YSBwcm9kdWN0cyB0aHJvdWdoIHRoZSBjb21iaW5hdGlvbiBvZiBBbGdvcml0aG1zIGFuZCBEYXRhIiA8PGV4dGVybmFsX3N5c3RlbT4+IGFzIHNwcw0KcmVjdGFuZ2xlICI9PURhdGEgU2VydmljZXNcblxuIFN1YnN5c3RlbSBmb3IgaW5nZXN0aW9uLCBzdG9yYWdlLCBhbmQgYWNjZXNzIHRvIGRhdGEgcHJvZHVjdHMgZm9yIHVzZSBpbiB0aGUgVW5pdHkgU3lzdGVtLiIgPDxleHRlcm5hbF9zeXN0ZW0+PiBhcyBkcw0KcmVjdGFuZ2xlICI9PUNvbW1vbiBTZXJ2aWNlc1xuXG4gUGxhdGZvcm0gd2lkZSB0b29sIGFuZCBmdW5jdGlvbmFsIGltcGxlbWVudGF0aW9ucyBpbmNsdWRpbmcgYXV0aGVudGljYXRpb24gYW5kIGF1dGhvcml6YXRpb24sIG1ldHJpY3MgcHVibGljYXRpb24sIGxvZ2dpbmcgc2VydmljZXMsIGRlcGxveW1lbnQgYW5kIGJ1aWxkIHN5c3RlbXMiIDw8ZXh0ZXJuYWxfc3lzdGVtPj4gYXMgY3MNCnJlY3RhbmdsZSAiPT1BbGdvcml0aG0gRGV2ZWxvcG1lbnRcblxuIFN1YnN5c3RlbSBmb3IgZGV2ZWxvcGluZyBhbmQgYXNzZW1ibGluZyBzY2llbmNlIGFsZ29yaXRobXMgaW50byBhbiBhbGdvcml0aG0gY2F0YWxvZyIgPDxleHRlcm5hbF9zeXN0ZW0+PiBhcyBhZHMNCg0KDQpyZWN0YW5nbGUgIj09YW5hbHlzaXMgU2VydmljZXNcbjxzaXplOjEyPltTeXN0ZW1dPC9zaXplPiIgPDxib3VuZGFyeT4+IGFzIGFzIHsNCiAgICByZWN0YW5nbGUgIj09VHJhbnNmb3JtYXRpb24gU2VydmljZVxuLy88c2l6ZToxMj5bV0NTLCBXQ1BTXTwvc2l6ZT4vL1xuXG4gVHJhbnNmb3JtcyBkYXRhIHByb2R1Y3RzIiA8PGNvbnRhaW5lcj4+IGFzIHRybnNmcm0NCiAgICByZWN0YW5nbGUgIj09QW5hbHlzaXMgT3B0aW1pemVkIERhdGEgU3RvcmVzIChBT0RTKVxuLy88c2l6ZToxMj5bXTwvc2l6ZT4vL1xuXG4gU3RvcmFnZSBvZiBub24tb3B0aW1pemVkIGRhdGEgaW4gYW5hbHlzaXMgb3B0aW1pemVkIGZvcm1hdHMiIDw8Y29udGFpbmVyPj4gYXMgYW9kcw0KDQp0cm5zZnJtIC0gLT4+IGFvZHMgOiAqKlJldHJpZXZlcyBEYXRhIEZyb20qKg0KfQ0KDQphb2RzIC0gLT4+IGRzIDogKipvcHRpbWl6ZXMgYW5kIHN0b3Jlc3MgZGF0YSBmcm9tKioNCnRybnNmcm0gLSAtPj4gZHMgOiAqKlJldHJpZXZlcyBEYXRhIEZyb20qKg0KdHJuc2ZybSAtIC0+PiBzcHMgOiAqKlJlcXVlc3RzIGxhcmdlIHNjYWxlIHByb2Nlc3NpbmcgZnJvbSoqDQoNCmFkcyAtIC0+PiB0cm5zZnJtIDogKipSZXF1ZXN0cyB0cmFuc2Zvcm1lZCBkYXRhIGZyb20qKg0KDQpAZW5kdW1sDQoKUGxhbnRVTUwgdmVyc2lvbiAxLjIwMjIuMyhUdWUgTWFyIDI5IDE2OjEwOjU3IEdNVCAyMDIyKQooR1BMIHNvdXJjZSBkaXN0cmlidXRpb24pCkphdmEgUnVudGltZTogT3BlbkpESyBSdW50aW1lIEVudmlyb25tZW50CkpWTTogT3BlbkpESyA2NC1CaXQgU2VydmVyIFZNCkRlZmF1bHQgRW5jb2Rpbmc6IFVURi04Ckxhbmd1YWdlOiBlbgpDb3VudHJ5OiBVUwotLT48L2c+PC9zdmc+) [Download system diagram](system.svg ':ignore') # Analysis Services ======================= File: docs/1. Unity Architecture/Algorithm Development/Application Catalog/README.md ======================= <reponame>unity-sds/unity-architecture # Application Catalog `/1. Unity Architecture/Algorithm Development/Application Catalog` * [Overview](../../../README.md) * [1. Unity Architecture](../../../1.%20Unity%20Architecture/README.md) * [Algorithm Development](../../../1.%20Unity%20Architecture/Algorithm%20Development/README.md) * [**Application Catalog**](../../../1.%20Unity%20Architecture/Algorithm%20Development/Application%20Catalog/README.md) * [Analysis Services](../../../1.%20Unity%20Architecture/Analysis%20Services/README.md) * [Common Services](../../../1.%20Unity%20Architecture/Common%20Services/README.md) * [Data Services](../../../1.%20Unity%20Architecture/Data%20Services/README.md) * [Science Processing](../../../1.%20Unity%20Architecture/Science%20Processing/README.md) * [2. Unity Diagrams](../../../2.%20Unity%20Diagrams/README.md) * [Algorithm Execution](../../../2.%20Unity%20Diagrams/Algorithm%20Execution/README.md) * [Data Access](../../../2.%20Unity%20Diagrams/Data%20Access/README.md) * [Process Execution](../../../2.%20Unity%20Diagrams/Process%20Execution/README.md) * [Process Deploment](../../../2.%20Unity%20Diagrams/Process%20Execution/Process%20Deploment/README.md) * [Process Request](../../../2.%20Unity%20Diagrams/Process%20Execution/Process%20Request/README.md) * [Process Status](../../../2.%20Unity%20Diagrams/Process%20Execution/Process%20Status/README.md) * [Processing Response](../../../2.%20Unity%20Diagrams/Process%20Execution/Processing%20Response/README.md) * [3. Deployment Diagrams](../../../3.%20Deployment%20Diagrams/README.md) * [4. Unity Glossary](../../../4.%20Unity%20Glossary/README.md) --- [Algorithm Development (up)](../../../1.%20Unity%20Architecture/Algorithm%20Development/README.md) --- ![container](data:image/svg+xml;base64,PD94bWwgdmV<KEY>) [Download container diagram](container.svg ':ignore') **Level 3: Component diagram** Next you can zoom in and decompose each container further to identify the major structural building blocks and their interactions. The Component diagram shows how a container is made up of a number of "components", what each of those components are, their responsibilities and the technology/implementation details. **Scope**: A single container. **Primary elements**: Components within the container in scope. Supporting elements: Containers (within the software system in scope) plus people and software systems directly connected to the components. **Intended audience**: Software architects and developers. > Example of included local image ![](2020-01-10-16-21-41.png) ======================= File: docs/2. Unity Diagrams/Algorithm Execution/HOME.md ======================= <gh_stars>1-10 # Algorithm Execution ![01_Algorithm_overview](data:image/svg+xml;base64,<KEY>) [Download 01_Algorithm_overview diagram](01_Algorithm_overview.svg ':ignore') ![02_Algorithm_Data_In](data:image/svg+xml;base64,<KEY>) [Download 02_Algorithm_Data_In diagram](02_Algorithm_Data_In.svg ':ignore') ![03_Algorithm_Process](data:image/svg+xml;base64,<KEY> [Download 03_Algorithm_Process diagram](03_Algorithm_Process.svg ':ignore') ![04_Algorithm_Data_Out](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBjb250ZW50U3R5bGVUeXBlPSJ0ZXh0L2NzcyIgaGVpZ2h0PSI1NjhweCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSIgc3R5bGU9IndpZHRoOjYwMnB4O2hlaWdodDo1NjhweDtiYWNrZ3JvdW5kOiNGRkZGRkY7IiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA2MDIgNTY4IiB3aWR0aD0iNjAycHgiIHpvb21BbmRQYW49Im1hZ25pZnkiPjxkZWZzLz48Zz48cmVjdCBoZWlnaHQ9IjI2LjI5NjkiIHN0eWxlPSJzdHJva2U6IzAwMDAwMDAwO3N0cm9rZS13aWR0aDoxLjA7ZmlsbDpub25lOyIgd2lkdGg9IjE3NCIgeD0iMjEyLjc1IiB5PSIxNSIvPjx0ZXh0IGZpbGw9IiMwMDAwMDAiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBmb250LXdlaWdodD0iYm9sZCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIxNjQiIHg9IjIxNy43NSIgeT0iMzIuOTk1MSI+QURFUyBEYXRhIFN0YWdlIE91dDwvdGV4dD48cGF0aCBkPSJNMjI2LDQ3LjI5NjkgTDIyNiw3NS45OTYxIEwyMDYsNzkuOTk2MSBMMjI2LDgzLjk5NjEgTDIyNiwxMTIuNjk1MyBBMCwwIDAgMCAwIDIyNiwxMTIuNjk1MyBMNTYwLDExMi42OTUzIEEwLDAgMCAwIDAgNTYwLDExMi42OTUzIEw1NjAsNTcuMjk2OSBMNTUwLDQ3LjI5NjkgTDIyNiw0Ny4yOTY5IEEwLDAgMCAwIDAgMjI2LDQ3LjI5NjkgIiBmaWxsPSIjRkVGRkREIiBzdHlsZT0ic3Ryb2tlOiMxODE4MTg7c3Ryb2tlLXdpZHRoOjAuNTsiLz48cGF0aCBkPSJNNTUwLDQ3LjI5NjkgTDU1MCw1Ny4yOTY5IEw1NjAsNTcuMjk2OSBMNTUwLDQ3LjI5NjkgIiBmaWxsPSIjRkVGRkREIiBzdHlsZT0ic3Ryb2tlOiMxODE4MTg7c3Ryb2tlLXdpZHRoOjAuNTsiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMyIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIxNDkiIHg9IjIzMiIgeT0iNjQuMzYzOCI+RGF0YSBTdGFnZU91dCBWb2x1bWU8L3RleHQ+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTMiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iMTk1IiB4PSIyMzIiIHk9Ijc5LjQ5NjYiPisgQ2F0YWxvZy5qc29uIChTVEFDIENhdGFsb2cpPC90ZXh0PjxsaW5lIHN0eWxlPSJzdHJva2U6IzE4MTgxODtzdHJva2Utd2lkdGg6MS4wOyIgeDE9IjIyNiIgeDI9IjU2MCIgeTE9Ijg3LjU2MjUiIHkyPSI4Ny41NjI1Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTojMTgxODE4O3N0cm9rZS13aWR0aDoxLjA7IiB4MT0iMjI2IiB4Mj0iNTYwIiB5MT0iODkuNTYyNSIgeTI9Ijg5LjU2MjUiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMyIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIzMTMiIHg9IjIzMiIgeT0iMTA0LjYyOTQiPkZpbGUgb3JnYW5pemVkIGluIG91dCBmb2xkZXIgd2l0aCBTVEFDIERvY3VtZW50czwvdGV4dD48ZWxsaXBzZSBjeD0iMTk2IiBjeT0iNzkuOTk2MSIgZmlsbD0iIzIyMjIyMiIgcng9IjEwIiByeT0iMTAiIHN0eWxlPSJzdHJva2U6IzIyMjIyMjtzdHJva2Utd2lkdGg6MS4wOyIvPjxyZWN0IGZpbGw9Im5vbmUiIGhlaWdodD0iMTcyLjMyMDMiIHN0eWxlPSJzdHJva2U6IzAwMDAwMDtzdHJva2Utd2lkdGg6MS41OyIgd2lkdGg9IjUxNiIgeD0iMTEiIHk9IjE3Ni42NjQxIi8+PHBhdGggZD0iTTIwNywxNzYuNjY0MSBMMjA3LDE4NS45NjA5IEwxOTcsMTk1Ljk2MDkgTDExLDE5NS45NjA5ICIgZmlsbD0ibm9uZSIgc3R5bGU9InN0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoxLjU7Ii8+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iMTg2IiB4PSIxNCIgeT0iMTkwLjY1OTIiPlJlc291cmNlIFNoaXBwaW5nIE1vZHVsZTwvdGV4dD48cGF0aCBkPSJNMzIyLDIxOC43ODEzIEwzMjIsMjM5LjkxNDEgTDMwMiwyNDMuOTE0MSBMMzIyLDI0Ny45MTQxIEwzMjIsMjY5LjA0NjkgQTAsMCAwIDAgMCAzMjIsMjY5LjA0NjkgTDUxNywyNjkuMDQ2OSBBMCwwIDAgMCAwIDUxNywyNjkuMDQ2OSBMNTE3LDIyOC43ODEzIEw1MDcsMjE4Ljc4MTMgTDMyMiwyMTguNzgxMyBBMCwwIDAgMCAwIDMyMiwyMTguNzgxMyAiIGZpbGw9IiNGRUZGREQiIHN0eWxlPSJzdHJva2U6IzE4MTgxODtzdHJva2Utd2lkdGg6MC41OyIvPjxwYXRoIGQ9Ik01MDcsMjE4Ljc4MTMgTDUwNywyMjguNzgxMyBMNTE3LDIyOC43ODEzIEw1MDcsMjE4Ljc4MTMgIiBmaWxsPSIjRkVGRkREIiBzdHlsZT0ic3Ryb2tlOiMxODE4MTg7c3Ryb2tlLXdpZHRoOjAuNTsiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMyIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIxNzQiIHg9IjMyOCIgeT0iMjM1Ljg0ODEiPlJlc291cmNlIE1hbmFnZXIgU3RvcmFnZTwvdGV4dD48bGluZSBzdHlsZT0ic3Ryb2tlOiMxODE4MTg7c3Ryb2tlLXdpZHRoOjEuMDsiIHgxPSIzMjIiIHgyPSI1MTciIHkxPSIyNDMuOTE0MSIgeTI9IjI0My45MTQxIi8+PGxpbmUgc3R5bGU9InN0cm9rZTojMTgxODE4O3N0cm9rZS13aWR0aDoxLjA7IiB4MT0iMzIyIiB4Mj0iNTE3IiB5MT0iMjQ1LjkxNDEiIHkyPSIyNDUuOTE0MSIvPjx0ZXh0IGZpbGw9IiMwMDAwMDAiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEzIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjY0IiB4PSIzMjgiIHk9IjI2MC45ODEiPi0gVS1EUyBTMzwvdGV4dD48cmVjdCBmaWxsPSIjRjFGMUYxIiBoZWlnaHQ9IjYxLjkwNjMiIHJ4PSIxMi41IiByeT0iMTIuNSIgc3R5bGU9InN0cm9rZTojMTgxODE4O3N0cm9rZS13aWR0aDowLjU7IiB3aWR0aD0iMjEyIiB4PSI5MCIgeT0iMjEyLjk2MDkiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMiIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIxNTEiIHg9IjEwMCIgeT0iMjM0LjA5OTYiPlVwbG9hZCBvciBsaW5rIGRhdGEgRmlsZXM8L3RleHQ+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTIiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iMjgiIHg9IjEwMCIgeT0iMjQ4LjA2ODQiPmZyb208L3RleHQ+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTIiIGZvbnQtd2VpZ2h0PSJib2xkIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjE2MCIgeD0iMTMyIiB5PSIyNDguMDY4NCI+RGF0YSBTdGFnZU91dCB2b2x1bWU8L3RleHQ+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTIiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iMTM1IiB4PSIxMDAiIHk9IjI2Mi4wMzcxIj50byBSZXNvdXJjZSBNYW5hZ2VyPC90ZXh0PjxwYXRoIGQ9Ik0zOTEsMjg2LjcxODggTDM5MSwzMDcuODUxNiBMMzcxLDMxMS44NTE2IEwzOTEsMzE1Ljg1MTYgTDM5MSwzMzYuOTg0NCBBMCwwIDAgMCAwIDM5MSwzMzYuOTg0NCBMNDk5LDMzNi45ODQ0IEEwLDAgMCAwIDAgNDk5LDMzNi45ODQ0IEw0OTksMjk2LjcxODggTDQ4OSwyODYuNzE4OCBMMzkxLDI4Ni43MTg4IEEwLDAgMCAwIDAgMzkxLDI4Ni43MTg4ICIgZmlsbD0iI0ZFRkZERCIgc3R5bGU9InN0cm9rZTojMTgxODE4O3N0cm9rZS13aWR0aDowLjU7Ii8+PHBhdGggZD0iTTQ4OSwyODYuNzE4OCBMNDg5LDI5Ni43MTg4IEw0OTksMjk2LjcxODggTDQ4OSwyODYuNzE4OCAiIGZpbGw9IiNGRUZGREQiIHN0eWxlPSJzdHJva2U6IzE4MTgxODtzdHJva2Utd2lkdGg6MC41OyIvPjx0ZXh0IGZpbGw9IiMwMDAwMDAiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEzIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9Ijg3IiB4PSIzOTciIHk9IjMwMy43ODU2Ij5VLURTIENhdGFsb2c8L3RleHQ+PGxpbmUgc3R5bGU9InN0cm9rZTojMTgxODE4O3N0cm9rZS13aWR0aDoxLjA7IiB4MT0iMzkxIiB4Mj0iNDk5IiB5MT0iMzExLjg1MTYiIHkyPSIzMTEuODUxNiIvPjxsaW5lIHN0eWxlPSJzdHJva2U6IzE4MTgxODtzdHJva2Utd2lkdGg6MS4wOyIgeDE9IjM5MSIgeDI9IjQ5OSIgeTE9IjMxMy44NTE2IiB5Mj0iMzEzLjg1MTYiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMyIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIzOSIgeD0iMzk3IiB5PSIzMjguOTE4NSI+LSBDTk08L3RleHQ+PHJlY3QgZmlsbD0iI0YxRjFGMSIgaGVpZ2h0PSIzMy45Njg4IiByeD0iMTIuNSIgcnk9IjEyLjUiIHN0eWxlPSJzdHJva2U6IzE4MTgxODtzdHJva2Utd2lkdGg6MC41OyIgd2lkdGg9IjM1MCIgeD0iMjEiIHk9IjI5NC44NjcyIi8+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTIiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iMzMwIiB4PSIzMSIgeT0iMzE2LjAwNTkiPlB1Ymxpc2ggb3IgUmVnaXN0ZXIgZGF0YSwgbWV0YWRhdGEsIGFuZCBwcm92ZW5hbmNlPC90ZXh0PjxyZWN0IGZpbGw9IiNGMUYxRjEiIGhlaWdodD0iNDcuOTM3NSIgcng9IjEyLjUiIHJ5PSIxMi41IiBzdHlsZT0ic3Ryb2tlOiMxODE4MTg7c3Ryb2tlLXdpZHRoOjAuNTsiIHdpZHRoPSIyMDAiIHg9Ijk2IiB5PSIzNjguOTg0NCIvPjx0ZXh0IGZpbGw9IiMwMDAwMDAiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjU5IiB4PSIxMDYiIHk9IjM5MC4xMjMiPkdlbmVyYXRlPC90ZXh0Pjx0ZXh0IGZpbGw9IiMwMDAwMDAiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iYm9sZCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nIiB0ZXh0TGVuZ3RoPSIxMTciIHg9IjE2OSIgeT0iMzkwLjEyMyI+U1RBQyBkb2N1bWVudHM8L3RleHQ+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTIiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iMTM1IiB4PSIxMTAiIHk9IjQwNC4wOTE4Ij5mb3IgYWxsIHRoZSBjb3BpZWQgZmlsZXM8L3RleHQ+PHJlY3QgZmlsbD0iI0YxRjFGMSIgaGVpZ2h0PSIzMy45Njg4IiByeD0iMTIuNSIgcnk9IjEyLjUiIHN0eWxlPSJzdHJva2U6IzE4MTgxODtzdHJva2Utd2lkdGg6MC41OyIgd2lkdGg9IjI1MCIgeD0iNzEiIHk9IjEzMi42OTUzIi8+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTIiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iMjMwIiB4PSI4MSIgeT0iMTUzLjgzNCI+Zm9yIGVhY2ggY2hpbGQgb3IgaXRlbSBpbiBDYXRhbG9nLmpzb248L3RleHQ+PHBvbHlnb24gZmlsbD0iI0YxRjFGMSIgcG9pbnRzPSIxNDMuNSw0MzYuOTIxOSwyNDguNSw0MzYuOTIxOSwyNjAuNSw0NDguOTIxOSwyNDguNSw0NjAuOTIxOSwxNDMuNSw0NjAuOTIxOSwxMzEuNSw0NDguOTIxOSwxNDMuNSw0MzYuOTIxOSIgc3R5bGU9InN0cm9rZTojMTgxODE4O3N0cm9rZS13aWR0aDowLjU7Ii8+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTEiIGxlbmd0aEFkanVzdD0ic3BhY2luZyIgdGV4dExlbmd0aD0iMTA1IiB4PSIxNDMuNSIgeT0iNDUyLjczIj5Nb3JlIFBhcmFtZXRlcnM/PC90ZXh0Pjx0ZXh0IGZpbGw9IiMwMDAwMDAiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjExIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjIwIiB4PSIyNjAuNSIgeT0iNDQ2LjMyNzYiPnllczwvdGV4dD48cGF0aCBkPSJNMzI2LjUsNDgwLjMzOTggTDMyNi41LDQ5My45MDYzIEwzMDYuNSw0OTcuOTA2MyBMMzI2LjUsNTAxLjkwNjMgTDMyNi41LDUxNS40NzI3IEEwLDAgMCAwIDAgMzI2LjUsNTE1LjQ3MjcgTDU5MC41LDUxNS40NzI3IEEwLDAgMCAwIDAgNTkwLjUsNTE1LjQ3MjcgTDU5MC41LDQ5MC4zMzk4IEw1ODAuNSw0ODAuMzM5OCBMMzI2LjUsNDgwLjMzOTggQTAsMCAwIDAgMCAzMjYuNSw0ODAuMzM5OCAiIGZpbGw9IiNGRUZGREQiIHN0eWxlPSJzdHJva2U6IzE4MTgxODtzdHJva2Utd2lkdGg6MC41OyIvPjxwYXRoIGQ9Ik01ODAuNSw0ODAuMzM5OCBMNTgwLjUsNDkwLjMzOTggTDU5MC41LDQ5MC4zMzk4IEw1ODAuNSw0ODAuMzM5OCAiIGZpbGw9IiNGRUZGREQiIHN0eWxlPSJzdHJva2U6IzE4MTgxODtzdHJva2Utd2lkdGg6MC41OyIvPjx0ZXh0IGZpbGw9IiMwMDAwMDAiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEzIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjI0MyIgeD0iMzMyLjUiIHk9IjQ5Ny40MDY3Ij5PR0MgQVBJIFByb2Nlc3NlcyBFeGVjdXRlIFJlc3BvbnNlPC90ZXh0PjxsaW5lIHN0eWxlPSJzdHJva2U6IzE4MTgxODtzdHJva2Utd2lkdGg6MS4wOyIgeDE9IjMyNi41IiB4Mj0iNTkwLjUiIHkxPSI1MDUuNDcyNyIgeTI9IjUwNS40NzI3Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTojMTgxODE4O3N0cm9rZS13aWR0aDoxLjA7IiB4MT0iMzI2LjUiIHgyPSI1OTAuNSIgeTE9IjUwNy40NzI3IiB5Mj0iNTA3LjQ3MjciLz48cmVjdCBmaWxsPSIjRjFGMUYxIiBoZWlnaHQ9IjMzLjk2ODgiIHJ4PSIxMi41IiByeT0iMTIuNSIgc3R5bGU9InN0cm9rZTojMTgxODE4O3N0cm9rZS13aWR0aDowLjU7IiB3aWR0aD0iMjIxIiB4PSI4NS41IiB5PSI0ODAuOTIxOSIvPjx0ZXh0IGZpbGw9IiMwMDAwMDAiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjIwMSIgeD0iOTUuNSIgeT0iNTAyLjA2MDUiPkdlbmVyYXRlIFdQUyBFeGVjdXRpb24gUmVwb3J0PC90ZXh0PjxlbGxpcHNlIGN4PSIxOTYiIGN5PSI1NDYuNDcyNyIgcng9IjExIiByeT0iMTEiIHN0eWxlPSJzdHJva2U6IzIyMjIyMjtzdHJva2Utd2lkdGg6MS4wO2ZpbGw6bm9uZTsiLz48ZWxsaXBzZSBjeD0iMTk2IiBjeT0iNTQ2LjQ3MjciIGZpbGw9IiMyMjIyMjIiIHJ4PSI2IiByeT0iNiIgc3R5bGU9InN0cm9rZTojMTExMTExO3N0cm9rZS13aWR0aDoxLjA7Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTojMTgxODE4O3N0cm9rZS13aWR0aDoxLjA7IiB4MT0iMTk2IiB4Mj0iMTk2IiB5MT0iMjc0Ljg2NzIiIHkyPSIyOTQuODY3MiIvPjxwb2x5Z29uIGZpbGw9IiMxODE4MTgiIHBvaW50cz0iMTkyLDI4NC44NjcyLDE5NiwyOTQuODY3MiwyMDAsMjg0Ljg2NzIsMTk2LDI4OC44NjcyIiBzdHlsZT0ic3Ryb2tlOiMxODE4MTg7c3Ryb2tlLXdpZHRoOjEuMDsiLz48bGluZSBzdHlsZT0ic3Ryb2tlOiMxODE4MTg7c3Ryb2tlLXdpZHRoOjEuMDsiIHgxPSIxOTYiIHgyPSIxOTYiIHkxPSIzMjguODM1OSIgeTI9IjM2OC45ODQ0Ii8+PHBvbHlnb24gZmlsbD0iIzE4MTgxOCIgcG9pbnRzPSIxOTIsMzU4Ljk4NDQsMTk2LDM2OC45ODQ0LDIwMCwzNTguOTg0NCwxOTYsMzYyLjk4NDQiIHN0eWxlPSJzdHJva2U6IzE4MTgxODtzdHJva2Utd2lkdGg6MS4wOyIvPjxsaW5lIHN0eWxlPSJzdHJva2U6IzE4MTgxODtzdHJva2Utd2lkdGg6MS4wOyIgeDE9IjE5NiIgeDI9IjE5NiIgeTE9IjE2Ni42NjQxIiB5Mj0iMjEyLjk2MDkiLz48cG9seWdvbiBmaWxsPSIjMTgxODE4IiBwb2ludHM9IjE5MiwyMDIuOTYwOSwxOTYsMjEyLjk2MDksMjAwLDIwMi45NjA5LDE5NiwyMDYuOTYwOSIgc3R5bGU9InN0cm9rZTojMTgxODE4O3N0cm9rZS13aWR0aDoxLjA7Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTojMTgxODE4O3N0cm9rZS13aWR0aDoxLjA7IiB4MT0iMjYwLjUiIHgyPSI1MzkiIHkxPSI0NDguOTIxOSIgeTI9IjQ0OC45MjE5Ii8+PHBvbHlnb24gZmlsbD0iIzE4MTgxOCIgcG9pbnRzPSI1MzUsMzA0LjIyNjYsNTM5LDI5NC4yMjY2LDU0MywzMDQuMjI2Niw1MzksMzAwLjIyNjYiIHN0eWxlPSJzdHJva2U6IzE4MTgxODtzdHJva2Utd2lkdGg6MS4wOyIvPjxsaW5lIHN0eWxlPSJzdHJva2U6IzE4MTgxODtzdHJva2Utd2lkdGg6MS4wOyIgeDE9IjUzOSIgeDI9IjUzOSIgeTE9IjE0OS42Nzk3IiB5Mj0iNDQ4LjkyMTkiLz48bGluZSBzdHlsZT0ic3Ryb2tlOiMxODE4MTg7c3Ryb2tlLXdpZHRoOjEuMDsiIHgxPSI1MzkiIHgyPSIzMjEiIHkxPSIxNDkuNjc5NyIgeTI9IjE0OS42Nzk3Ii8+PHBvbHlnb24gZmlsbD0iIzE4MTgxOCIgcG9pbnRzPSIzMzEsMTQ1LjY3OTcsMzIxLDE0OS42Nzk3LDMzMSwxNTMuNjc5NywzMjcsMTQ5LjY3OTciIHN0eWxlPSJzdHJva2U6IzE4MTgxODtzdHJva2Utd2lkdGg6MS4wOyIvPjxsaW5lIHN0eWxlPSJzdHJva2U6IzE4MTgxODtzdHJva2Utd2lkdGg6MS4wOyIgeDE9IjE5NiIgeDI9IjE5NiIgeTE9IjQxNi45MjE5IiB5Mj0iNDM2LjkyMTkiLz48cG9seWdvbiBmaWxsPSIjMTgxODE4IiBwb2ludHM9IjE5Miw0MjYuOTIxOSwxOTYsNDM2LjkyMTksMjAwLDQyNi45MjE5LDE5Niw0MzAuOTIxOSIgc3R5bGU9InN0cm9rZTojMTgxODE4O3N0cm9rZS13aWR0aDoxLjA7Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTojMTgxODE4O3N0cm9rZS13aWR0aDoxLjA7IiB4MT0iMTk2IiB4Mj0iMTk2IiB5MT0iODkuOTk2MSIgeTI9IjEzMi42OTUzIi8+PHBvbHlnb24gZmlsbD0iIzE4MTgxOCIgcG9pbnRzPSIxOTIsMTIyLjY5NTMsMTk2LDEzMi42OTUzLDIwMCwxMjIuNjk1MywxOTYsMTI2LjY5NTMiIHN0eWxlPSJzdHJva2U6IzE4MTgxODtzdHJva2Utd2lkdGg6MS4wOyIvPjxsaW5lIHN0eWxlPSJzdHJva2U6IzE4MTgxODtzdHJva2Utd2lkdGg6MS4wOyIgeDE9IjE5NiIgeDI9IjE5NiIgeTE9IjQ2MC45MjE5IiB5Mj0iNDgwLjkyMTkiLz48cG9seWdvbiBmaWxsPSIjMTgxODE4IiBwb2ludHM9IjE5Miw0NzAuOTIxOSwxOTYsNDgwLjkyMTksMjAwLDQ3MC45MjE5LDE5Niw0NzQuOTIxOSIgc3R5bGU9InN0cm9rZTojMTgxODE4O3N0cm9rZS13aWR0aDoxLjA7Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTojMTgxODE4O3N0cm9rZS13aWR0aDoxLjA7IiB4MT0iMTk2IiB4Mj0iMTk2IiB5MT0iNTE0Ljg5MDYiIHkyPSI1MzUuNDcyNyIvPjxwb2x5Z29uIGZpbGw9IiMxODE4MTgiIHBvaW50cz0iMTkyLDUyNS40NzI3LDE5Niw1MzUuNDcyNywyMDAsNTI1LjQ3MjcsMTk2LDUyOS40NzI3IiBzdHlsZT0ic3Ryb2tlOiMxODE4MTg7c3Ryb2tlLXdpZHRoOjEuMDsiLz48IS0tTUQ1PVtmOGNlNzNhNDU5YWRlYzIwMDkxNDY0NGY3MWQxZWE5NF0KQHN0YXJ0dW1sDQp0aXRsZSBBREVTIERhdGEgU3RhZ2UgT3V0DQoNCnN0YXJ0DQpub3RlIHJpZ2h0DQogIERhdGEgU3RhZ2VPdXQgVm9sdW1lDQogICsgQ2F0YWxvZy5qc29uIChTVEFDIENhdGFsb2cpDQogID09PT0NCiAgRmlsZSBvcmdhbml6ZWQgaW4gb3V0IGZvbGRlciB3aXRoIFNUQUMgRG9jdW1lbnRzDQplbmQgbm90ZQ0KDQpyZXBlYXQgOmZvciBlYWNoIGNoaWxkIG9yIGl0ZW0gaW4gQ2F0YWxvZy5qc29uOw0KDQogIHBhcnRpdGlvbiAiUmVzb3VyY2UgU2hpcHBpbmcgTW9kdWxlIiB7DQoNCiAgICAgIDpVcGxvYWQgb3IgbGluayBkYXRhIEZpbGVzDQogICAgICBmcm9tICoqRGF0YSBTdGFnZU91dCB2b2x1bWUqKg0KICAgICAgdG8gUmVzb3VyY2UgTWFuYWdlcjsNCiAgICAgIG5vdGUgcmlnaHQNCiAgICAgICAgUmVzb3VyY2UgTWFuYWdlciBTdG9yYWdlDQogICAgICAgID09PT0NCiAgICAgICAgLSBVLURTIFMzDQogICAgICBlbmQgbm90ZQ0KICAgICAgOlB1Ymxpc2ggb3IgUmVnaXN0ZXIgZGF0YSwgbWV0YWRhdGEsIGFuZCBwcm92ZW5hbmNlOw0KICAgICAgbm90ZSByaWdodA0KICAgICAgICBVLURTIENhdGFsb2cNCiAgICAgICAgPT09PQ0KICAgICAgICAtIENOTQ0KICAgICAgZW5kIG5vdGUNCg0KICB9DQoNCiAgOkdlbmVyYXRlICoqU1RBQyBkb2N1bWVudHMqKg0KICAgZm9yIGFsbCB0aGUgY29waWVkIGZpbGVzOw0KDQpyZXBlYXQgd2hpbGUgKE1vcmUgUGFyYW1ldGVycz8pIGlzICh5ZXMpDQo6R2VuZXJhdGUgV1BTIEV4ZWN1dGlvbiBSZXBvcnQ7DQpub3RlIHJpZ2h0DQogIE9HQyBBUEkgUHJvY2Vzc2VzIEV4ZWN1dGUgUmVzcG9uc2UNCiAgPT09PQ0KZW5kIG5vdGUNCg0Kc3RvcA0KDQoNCkBlbmR1bWwNCgpQbGFudFVNTCB2ZXJzaW9uIDEuMjAyMi4zKFR1ZSBNYXIgMjkgMTY6MTA6NTcgR01UIDIwMjIpCihHUEwgc291cmNlIGRpc3RyaWJ1dGlvbikKSmF2YSBSdW50aW1lOiBPcGVuSkRLIFJ1bnRpbWUgRW52aXJvbm1lbnQKSlZNOiBPcGVuSkRLIDY0LUJpdCBTZXJ2ZXIgVk0KRGVmYXVsdCBFbmNvZGluZzogVVRGLTgKTGFuZ3VhZ2U6IGVuCkNvdW50cnk6IFVTCi0tPjwvZz48L3N2Zz4=) [Download 04_Algorithm_Data_Out diagram](04_Algorithm_Data_Out.svg ':ignore') # Algorithm Execution https://docs.ogc.org/bp/20-089r1.html#toc38 ======================= File: docs/HOME.md ======================= # Overview ![context](data:image/svg+xml;base64,<KEY>) [Download context diagram](context.svg ':ignore') # Unity System Context Diagram The Unity system context diagram shows where the Unity system lives in relation to other pieces of the Science Processing ecosystem. For example, the context diagram above shows that 'archive' functionality happens *after* the Unity systems interactions. For more information on the Unity system, continue to explore the diagrams and architecture presented here. ======================= File: docs/1. Unity Architecture/Algorithm Development/Application Catalog/HOME.md ======================= <reponame>unity-sds/unity-architecture # Application Catalog ![container](data:image/svg+xml;base64,<KEY>) [Download container diagram](container.svg ':ignore') **Level 3: Component diagram** Next you can zoom in and decompose each container further to identify the major structural building blocks and their interactions. The Component diagram shows how a container is made up of a number of "components", what each of those components are, their responsibilities and the technology/implementation details. **Scope**: A single container. **Primary elements**: Components within the container in scope. Supporting elements: Containers (within the software system in scope) plus people and software systems directly connected to the components. **Intended audience**: Software architects and developers. > Example of included local image ![](2020-01-10-16-21-41.png) ======================= File: docs/2. Unity Diagrams/Process Execution/Process Status/HOME.md ======================= # Process Status ![03_Process_Status](data:image/svg+xml;base64,<KEY>) [Download 03_Process_Status diagram](03_Process_Status.svg ':ignore') ======================= File: docs/4. Unity Glossary/HOME.md ======================= <reponame>unity-sds/unity-architecture<gh_stars>1-10 # 4. Unity Glossary | Term | Definition | Notes | | ---- | -----------| ----- | | | TBD | | | ADES | *See Application deployment and Execution Service* | | | Algorithm | A conceptual set of steps or methods refining data into information | | | API | *See Application Programming Interface* | | | Application | The implementation of an algorithm via software. | | | Application Deployment and Execution Service (ADES) | TBD | | | Application Package | TBD | | | Application Programming Interface (API) | TBD | | | Archive | Long term storage location for data and related products, such as the algorithms and software used to generate them. NASA Archives include DAACs and PDS Nodes | | | Authentication | TBD | | | Authorization | TBD | | | Budget | TBD | | | CI/CD | *See Continuous Integration / Continuous Deployment* | | | Continuous Integration / Continuous Deployment | TBD | | | Cloud | TBD | | | Collection | TBD | | Container | TBD | | | Cost | TBD | | | DAAC | *See Distributed Active Archive Center* | | | DAPA | *See Data Access and Processing API* | | | Data Access and Processing API (DAPA) | TBD | | | Deployment | TBD | | | Discovery | TBD | | | Distributed Active Archive Center (DAAC) | TBD | | | Egress | TBD | | | Everything-as-a-Service (XaaS) | TBD | | | Granule | TBD | | | High Performance Computing environment| TBD | | | HPC | *See High Performance Computing environment* | | | Job | Combination of tasks that defines a transactional unit for the engine. The job succeeds if all tasks succeed. The job fails if any task fails. Always executed on the same worker node. | | | PDS | *see Planetary Data System*|| | Pipeline | Combination of workflows that are chained together by rules or triggers. Different workflows are started at different times. Logical concept rather than a defined construct supported by the engine.| | | Planetary Data System (PDS) | TBD | | | Project | TBD | | | Provenance | TBD | | | Task | Atomic set of operations (one or more) that cannot be further decomposed by the engine. Always run as a whole. | | | Tenant | TBD | | | Transform | TBD | | | UI | *See User Interface* | | | User Interface | TBD | | | User Experience | TBD | | | UX | *See User Experience* | | | Venue | TBD | | | Workflow | Combination of jobs and/or tasks that are defined to be executed together. Scheduled or triggered by a single event or request. Has a single start time. Information may be shared across jobs/tasks in the workflow. | | ======================= File: docs/1. Unity Architecture/README.md ======================= # 1. Unity Architecture `/1. Unity Architecture` * [Overview](../README.md) * [**1. Unity Architecture**](../1.%20Unity%20Architecture/README.md) * [Algorithm Development](../1.%20Unity%20Architecture/Algorithm%20Development/README.md) * [Application Catalog](../1.%20Unity%20Architecture/Algorithm%20Development/Application%20Catalog/README.md) * [Analysis Services](../1.%20Unity%20Architecture/Analysis%20Services/README.md) * [Common Services](../1.%20Unity%20Architecture/Common%20Services/README.md) * [Data Services](../1.%20Unity%20Architecture/Data%20Services/README.md) * [Science Processing](../1.%20Unity%20Architecture/Science%20Processing/README.md) * [2. Unity Diagrams](../2.%20Unity%20Diagrams/README.md) * [Algorithm Execution](../2.%20Unity%20Diagrams/Algorithm%20Execution/README.md) * [Data Access](../2.%20Unity%20Diagrams/Data%20Access/README.md) * [Process Execution](../2.%20Unity%20Diagrams/Process%20Execution/README.md) * [Process Deploment](../2.%20Unity%20Diagrams/Process%20Execution/Process%20Deploment/README.md) * [Process Request](../2.%20Unity%20Diagrams/Process%20Execution/Process%20Request/README.md) * [Process Status](../2.%20Unity%20Diagrams/Process%20Execution/Process%20Status/README.md) * [Processing Response](../2.%20Unity%20Diagrams/Process%20Execution/Processing%20Response/README.md) * [3. Deployment Diagrams](../3.%20Deployment%20Diagrams/README.md) * [4. Unity Glossary](../4.%20Unity%20Glossary/README.md) --- [Overview (up)](../README.md) - [Algorithm Development](../1.%20Unity%20Architecture/Algorithm%20Development/README.md) - [Analysis Services](../1.%20Unity%20Architecture/Analysis%20Services/README.md) - [Common Services](../1.%20Unity%20Architecture/Common%20Services/README.md) - [Data Services](../1.%20Unity%20Architecture/Data%20Services/README.md) - [Science Processing](../1.%20Unity%20Architecture/Science%20Processing/README.md) --- ![system](data:image/svg+xml;base64,<KEY>ZGUwOF<KEY>) [Download system diagram](system.svg ':ignore') **Level 2: Container diagram** Once you understand how your system fits in to the overall IT environment, a really useful next step is to zoom-in to the system boundary with a Container diagram. A "container" is something like a server-side web application, single-page application, desktop application, mobile app, database schema, file system, etc. Essentially, a container is a separately runnable/deployable unit (e.g. a separate process space) that executes code or stores data. The Container diagram shows the high-level shape of the software architecture and how responsibilities are distributed across it. It also shows the major technology choices and how the containers communicate with one another. It's a simple, high-level technology focussed diagram that is useful for software developers and support/operations staff alike. **Scope**: A single software system. **Primary elements**: Containers within the software system in scope. Supporting elements: People and software systems directly connected to the containers. **Intended audience**: Technical people inside and outside of the software development team; including software architects, developers and operations/support staff. **Notes**: This diagram says nothing about deployment scenarios, clustering, replication, failover, etc. ======================= File: src/2. Unity Diagrams/TOC.md ======================= # Table of Contents | Section | Description | | ----------- | ----------- | | Processing Execution | Diagrams about the interaction between services internal and external to the processing system. Includes algorithm deployment, algorithm execution, data staging, and more. | | Algorithm Flows | Algorithm processes | | Algorithm Building (CICD)| The build, test, and deployment of algorithm packages | | Data Access | Accessing Data for use within Unity | ======================= File: docs/2. Unity Diagrams/Process Execution/Process Request/HOME.md ======================= <gh_stars>1-10 # Process Request ![02_Process_Request](data:image/svg+xml;base64,<KEY>) [Download 02_Process_Request diagram](02_Process_Request.svg ':ignore') ======================= File: docs/1. Unity Architecture/Algorithm Development/HOME.md ======================= <gh_stars>1-10 # Algorithm Development ![system](data:image/svg+xml;base64,<KEY>MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwDQ<KEY>MDAwMDAwMDAwMDQ5QkNDQTcyMDAwMDAwMDAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwMDAwMDAwMDZFRkZGRkZGRkZCMzAwMDAwMDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMDAwMDFDRkZGRkZGRkZGRkZGNzAwMDAwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDAwMDAxRUZGRkZGRkZGRkZGRkZGODAwMDAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwMDAwMENGRkZGRkZGRkZGRkZGRkZGNjAwMDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMDA3RkZGRkZGRkZGRkZGRkZGRkZGMTAwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDAwMUZGRkZGRkZGRkZGRkZGRkZGRkY5MDAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwMDA2RkZGRkZGRkZGRkZGRkZGRkZGRkYwMDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMEJGRkZGRkZGRkZGRkZGRkZGRkZGRjQwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDAwRUZGRkZGRkZGRkZGRkZGRkZGRkZGNzAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwMDBGRkZGRkZGRkZGRkZGRkZGRkZGRkY4MDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMEZGRkZGRkZGRkZGRkZGRkZGRkZGRjgwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDAwREZGRkZGRkZGRkZGRkZGRkZGRkZGNjAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwMDBBRkZGRkZGRkZGRkZGRkZGRkZGRkY0MDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMDZGRkZGRkZGRkZGRkZGRkZGRkZGRTAwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDAwMEVGRkZGRkZGRkZGRkZGRkZGRkY4MDAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwMDAwN0ZGRkZGRkZGRkZGRkZGRkZGRjEwMDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMDAwQkZGRkZGRkZGRkZGRkZGRkY1MDAwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDAwMDAxREZGRkZGRkZGRkZGRkZGNzAwMDAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwMDAwMDAwQkZGRkZGRkZGRkZGRjUwMDAwMDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMDAwMDAwNURGRkZGRkZGRkExMDAwMDAwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDAwMDAwMDAwMDM3QUJCOTYxMDAwMDAwMDAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDAwMjU3ODgzMDAwMDAwMDAwMDU4ODY0MTAwMDAwMDAwMDAwMDANCjAwMDAwMDAwMDAwN0RGRkZGRkZEOTY0MzM0N0JGRkZGRkZGQjQwMDAwMDAwMDAwMA0KMDAwMDAwMDAwNEVGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkIxMDAwMDAwMDAwDQowMDAwMDAwMDdGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkQyMDAwMDAwMDANCjAwMDAwMDA2RkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkUxMDAwMDAwMA0KMDAwMDAwM0ZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkIwMDAwMDAwDQowMDAwMDBCRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRjUwMDAwMDANCjAwMDAwM0ZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRDAwMDAwMA0KMDAwMDA5RkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGMjAwMDAwDQowMDAwMERGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkY2MDAwMDANCjAwMDAwRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRjgwMDAwMA0KMDAwMDFGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGQTAwMDAwDQowMDAwMUZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZCMDAwMDANCjAwMDAxRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkIwMDAwMA0KMDAwMDFGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGQjAwMDAwDQowMDAwMUZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZBMDAwMDANCjAwMDAwRUZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRjcwMDAwMA0KMDAwMDA2RkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZFMTAwMDAwDQowMDAwMDA4RkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRDMwMDAwMDANCjAwMDAwMDAxNDU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTMwMDAwMDAwMA0KMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwDQowMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDANCn0NCg0KDQoNCg0KDQoNCg0KDQoNCg0KDQoNCg0KDQoNCg0Kc2tpbnBhcmFtIHJlY3RhbmdsZTw8Y29udGFpbmVyPj4gew0KICAgIFN0ZXJlb3R5cGVGb250Q29sb3IgI0ZGRkZGRg0KICAgIEZvbnRDb2xvciAjRkZGRkZGDQogICAgQmFja2dyb3VuZENvbG9yICM0MzhERDUNCiAgICBCb3JkZXJDb2xvciAjM0M3RkMwDQp9DQoNCnNraW5wYXJhbSBkYXRhYmFzZTw8Y29udGFpbmVyPj4gew0KICAgIFN0ZXJlb3R5cGVGb250Q29sb3IgI0ZGRkZGRg0KICAgIEZvbnRDb2xvciAjRkZGRkZGDQogICAgQmFja2dyb3VuZENvbG9yICM0MzhERDUNCiAgICBCb3JkZXJDb2xvciAjM0M3RkMwDQp9DQoNCnNraW5wYXJhbSBxdWV1ZTw8Y29udGFpbmVyPj4gew0KICAgIFN0ZXJlb3R5cGVGb250Q29sb3IgI0ZGRkZGRg0KICAgIEZvbnRDb2xvciAjRkZGRkZGDQogICAgQmFja2dyb3VuZENvbG9yICM0MzhERDUNCiAgICBCb3JkZXJDb2xvciAjM0M3RkMwDQp9DQoNCnNraW5wYXJhbSByZWN0YW5nbGU8PGV4dGVybmFsX2NvbnRhaW5lcj4+IHsNCiAgICBTdGVyZW90eXBlRm9udENvbG9yICNGRkZGRkYNCiAgICBGb250Q29sb3IgI0ZGRkZGRg0KICAgIEJhY2tncm91bmRDb2xvciAjQjNCM0IzDQogICAgQm9yZGVyQ29sb3IgI0E2QTZBNg0KfQ0KDQpza2lucGFyYW0gZGF0YWJhc2U8PGV4dGVybmFsX2NvbnRhaW5lcj4+IHsNCiAgICBTdGVyZW90eXBlRm9udENvbG9yICNGRkZGRkYNCiAgICBGb250Q29sb3IgI0ZGRkZGRg0KICAgIEJhY2tncm91bmRDb2xvciAjQjNCM0IzDQogICAgQm9yZGVyQ29sb3IgI0E2QTZBNg0KfQ0KDQpza2lucGFyYW0gcXVldWU8PGV4dGVybmFsX2NvbnRhaW5lcj4+IHsNCiAgICBTdGVyZW90eXBlRm9udENvbG9yICNGRkZGRkYNCiAgICBGb250Q29sb3IgI0ZGRkZGRg0KICAgIEJhY2tncm91bmRDb2xvciAjQjNCM0IzDQogICAgQm9yZGVyQ29sb3IgI0E2QTZBNg0KfQ0KDQoNCg0KDQoNCg0KDQoNCg0KDQoNCg0KDQoNCg0KDQoNCnNraW5wYXJhbSByZWN0YW5nbGU8PGNvbXBvbmVudD4+IHsNCiAgICBTdGVyZW90eXBlRm9udENvbG9yICMwMDAwMDANCiAgICBGb250Q29sb3IgIzAwMDAwMA0KICAgIEJhY2tncm91bmRDb2xvciAjODVCQkYwDQogICAgQm9yZGVyQ29sb3IgIzc4QThEOA0KfQ0KDQpza2lucGFyYW0gZGF0YWJhc2U8PGNvbXBvbmVudD4+IHsNCiAgICBTdGVyZW90eXBlRm9udENvbG9yICMwMDAwMDANCiAgICBGb250Q29sb3IgIzAwMDAwMA0KICAgIEJhY2tncm91bmRDb2xvciAjODVCQkYwDQogICAgQm9yZGVyQ29sb3IgIzc4QThEOA0KfQ0KDQpza2lucGFyYW0gcXVldWU8PGNvbXBvbmVudD4+IHsNCiAgICBTdGVyZW90eXBlRm9udENvbG9yICMwMDAwMDANCiAgICBGb250Q29sb3IgIzAwMDAwMA0KICAgIEJhY2tncm91bmRDb2xvciAjODVCQkYwDQogICAgQm9yZGVyQ29sb3IgIzc4QThEOA0KfQ0KDQpza2lucGFyYW0gcmVjdGFuZ2xlPDxleHRlcm5hbF9jb21wb25lbnQ+PiB7DQogICAgU3RlcmVvdHlwZUZvbnRDb2xvciAjMDAwMDAwDQogICAgRm9udENvbG9yICMwMDAwMDANCiAgICBCYWNrZ3JvdW5kQ29sb3IgI0NDQ0NDQw0KICAgIEJvcmRlckNvbG9yICNCRkJGQkYNCn0NCg0Kc2tpbnBhcmFtIGRhdGFiYXNlPDxleHRlcm5hbF9jb21wb25lbnQ+PiB7DQogICAgU3RlcmVvdHlwZUZvbnRDb2xvciAjMDAwMDAwDQogICAgRm9udENvbG9yICMwMDAwMDANCiAgICBCYWNrZ3JvdW5kQ29sb3IgI0NDQ0NDQw0KICAgIEJvcmRlckNvbG9yICNCRkJGQkYNCn0NCg0Kc2tpbnBhcmFtIHF1ZXVlPDxleHRlcm5hbF9jb21wb25lbnQ+PiB7DQogICAgU3RlcmVvdHlwZUZvbnRDb2xvciAjMDAwMDAwDQogICAgRm9udENvbG9yICMwMDAwMDANCiAgICBCYWNrZ3JvdW5kQ29sb3IgI0NDQ0NDQw0KICAgIEJvcmRlckNvbG9yICNCRkJGQkYNCn0NCg0KDQoNCg0KDQoNCg0KDQoNCg0KDQoNCmhpZGUgc3RlcmVvdHlwZQ0KbGVnZW5kIHJpZ2h0DQp8PGNvbG9yOiMwMDAwMDA+KipMZWdlbmQqKjwvY29sb3I+IHwNCnw8IzA4NDI3Qj4gcGVyc29uIHwNCnw8IzExNjhCRD4gc3lzdGVtIHwNCnw8IzQzOERENT4gY29udGFpbmVyIHwNCnw8Izg1QkJGMD4gY29tcG9uZW50IHwNCnw8IzY4Njg2OD4gZXh0ZXJuYWwgcGVyc29uIHwNCnw8Izk5OTk5OT4gZXh0ZXJuYWwgc3lzdGVtIHwNCnw8I0IzQjNCMz4gZXh0ZXJuYWwgY29udGFpbmVyIHwNCnw8I0NDQ0NDQz4gZXh0ZXJuYWwgY29tcG9uZW50IHwNCmVuZGxlZ2VuZA0KDQpyZWN0YW5nbGUgIj09U2NpZW5jZSBQcm9jZXNzaW5nXG5cbiBTdWJzeXN0ZW0gZm9yIHRoZSBnZW5lcmF0aW9uIG9mIHNjaWVuY2UgZGF0YSBwcm9kdWN0cyB0aHJvdWdoIHRoZSBjb21iaW5hdGlvbiBvZiBBbGdvcml0aG1zIGFuZCBEYXRhIiA8PGV4dGVybmFsX3N5c3RlbT4+IGFzIHNwcw0KcmVjdGFuZ2xlICI9PURhdGEgU2VydmljZXNcblxuIFN1YnN5c3RlbSBmb3IgaW5nZXN0aW9uLCBzdG9yYWdlLCBhbmQgYWNjZXNzIHRvIGRhdGEgcHJvZHVjdHMgZm9yIHVzZSBpbiB0aGUgVW5pdHkgU3lzdGVtLiIgPDxleHRlcm5hbF9zeXN0ZW0+PiBhcyBkcw0KcmVjdGFuZ2xlICI9PUFuYWx5c2lzIFNlcnZpY2VzXG5cbiBIaWdoZXIgbGV2ZWwgZGF0YSBmdW5jdGlvbnMgdG8gYWNjZXNzIGFuZCB0cmFuc2Zvcm0gZGF0YS4iIDw8ZXh0ZXJuYWxfc3lzdGVtPj4gYXMgYXMNCnJlY3RhbmdsZSAiPT1Db21tb24gU2VydmljZXNcblxuIFBsYXRmb3JtIHdpZGUgdG9vbCBhbmQgZnVuY3Rpb25hbCBpbXBsZW1lbnRhdGlvbnMgaW5jbHVkaW5nIGF1dGhlbnRpY2F0aW9uIGFuZCBhdXRob3JpemF0aW9uLCBtZXRyaWNzIHB1YmxpY2F0aW9uLCBsb2dnaW5nIHNlcnZpY2VzLCBkZXBsb3ltZW50IGFuZCBidWlsZCBzeXN0ZW1zIiA8PGV4dGVybmFsX3N5c3RlbT4+IGFzIGNzDQoNCg0KcmVjdGFuZ2xlICI9PUFsZ29yaXRobSBEZXZlbG9wbWVudFxuPHNpemU6MTI+W1N5c3RlbV08L3NpemU+IiA8PGJvdW5kYXJ5Pj4gYXMgQURTIHsNCiAgICByZWN0YW5nbGUgIj09QXBwbGljYXRpb24gQ2F0YWxvZ1xuLy88c2l6
67,155
thestackv1_concat_by_repo-long/65536-65536
Repo: xxdoc/vb6-code ======================= File: Brightness-effect/Part 4 - Even faster DIBs/README.md ======================= # Source code for tannerhelland.com articles Unless otherwise noted, all code in this repository is available under a Simplified BSD License. Full license text is available in [LICENSE.md](https://github.com/tannerhelland/vb6-code/blob/master/LICENSE.md). If you find the code useful, please consider [a small donation](https://paypal.me/TannerHelland). If you're unfamiliar with Git or GitHub, here is a brief overview of the many ways you can access this project: - Individual files can be browsed online by clicking on file/folder names - The entire code collection can be downloaded as a.zip file by visiting [the root repository folder](https://github.com/tannerhelland/vb6-code), then clicking the green "Clone or download" button on the right. - For best results, I recommend forking your own copy of the repository, using the "Fork" button in the top-right. This gives you your own copy of the source code to experiment with / modify / build as you see fit. Pre-compiled Windows executables are provided for all projects. For the paranoid, feel free to ignore or remove these, then manually build each project yourself. (A copy of the VB6 IDE will obviously be required.) Questions, comments, feedback, etc can be [filed as issues](https://github.com/tannerhelland/vb6-code/issues). [Pull requests](https://github.com/tannerhelland/vb6-code/pulls) are also welcome. ======================= File: README.md ======================= # Code downloads for tannerhelland.com Unless otherwise noted, all code in this repository is available under a Simplified BSD License. Full license text is available in LICENSE.md. If you find the code useful, please consider [a small donation](https://paypal.me/TannerHelland). If you're unfamiliar with Git or GitHub, here is a brief overview of the many ways you can access these projects: - Individual files can be browsed online by clicking on file/folder names - The entire repository can be downloaded as a.zip file by using the green "Clone or download" button - For best results, I recommend forking your own copy of the repository, using the "Fork" button. This gives you your own copy to play with / modify / build as you see fit. Pre-compiled Windows executables are provided for all projects. If you're paranoid, feel free to ignore/remove these from your own repo, and manually build all code. (A copy of the VB6 IDE will be required.) Questions, comments, feedback, etc can be filed as issues. Pull requests are also welcome. ======================= File: Transparency-2D/frmTransparency.frm ======================= VERSION 5.00 Begin VB.Form frmTransparency Appearance = 0 'Flat BackColor = &H00C0C0C0& Caption = "Real-time transparency - <EMAIL>" ClientHeight = 5730 ClientLeft = 60 ClientTop = 345 ClientWidth = 6330 Icon = "frmTransparency.frx":0000 LinkTopic = "Form1" ScaleHeight = 382 ScaleMode = 3 'Pixel ScaleWidth = 422 StartUpPosition = 2 'CenterScreen Begin VB.HScrollBar hScroll1 Height = 375 Left = 120 Max = 100 TabIndex = 4 Top = 5160 Value = 50 Width = 6015 End Begin VB.PictureBox Picture3 Appearance = 0 'Flat AutoRedraw = -1 'True BackColor = &H80000005& ForeColor = &H80000008& Height = 4530 Left = 120 ScaleHeight = 300 ScaleMode = 3 'Pixel ScaleWidth = 400 TabIndex = 2 Top = 120 Width = 6030 End Begin VB.PictureBox Picture2 Appearance = 0 'Flat AutoRedraw = -1 'True AutoSize = -1 'True BackColor = &H80000005& ForeColor = &H80000008& Height = 4530 Left = 120 Picture = "frmTransparency.frx":000C ScaleHeight = 300 ScaleMode = 3 'Pixel ScaleWidth = 400 TabIndex = 1 Top = 120 Visible = 0 'False Width = 6030 End Begin VB.PictureBox Picture1 Appearance = 0 'Flat AutoRedraw = -1 'True AutoSize = -1 'True BackColor = &H80000005& ForeColor = &H80000008& Height = 4530 Left = 120 Picture = "frmTransparency.frx":B2C5 ScaleHeight = 300 ScaleMode = 3 'Pixel ScaleWidth = 400 TabIndex = 0 Top = 120 Visible = 0 'False Width = 6030 End Begin VB.Label Label2 Alignment = 2 'Center Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "Percent Transparency:" BeginProperty Font Name = "Arial" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 255 Left = 1080 TabIndex = 5 Top = 4800 Width = 4335 End Begin VB.Label Label1 Caption = "%" Height = 255 Index = 0 Left = 3120 TabIndex = 3 Top = 840 Width = 255 End End Attribute VB_Name = "frmTransparency" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False '*************************************************************************** 'Copyright 2018 by <NAME> ' www.tanner<EMAIL>and.<EMAIL> ' 'Documentation for this project can be found at https://tannerhelland.com/code/ ' 'The source code in this project is licensed under a Simplified BSD license. ' For more information, please review LICENSE.md at https://github.com/tannerhelland/thdc-code/ ' 'If you find this code useful, please consider a small donation to https://www.paypal.me/TannerHelland ' '*************************************************************************** Private Sub Form_Load() 'When the program starts, combine the two images at 50% transparency DrawTransparency Picture1, Picture2, Picture3, 50 End Sub 'When the scrollbar is used, change transparency accordingly Private Sub hScroll1_Change() DrawTransparency Picture1, Picture2, Picture3, hScroll1.Value End Sub Private Sub hScroll1_Scroll() DrawTransparency Picture1, Picture2, Picture3, hScroll1.Value End Sub 'Draw an alpha blend from two source picture boxes into a destination picture box. 'The transparency value is a simple percentage from 1 to 100 Public Sub DrawTransparency(srcPic1 As PictureBox, srcPic2 As PictureBox, dstPic As PictureBox, ByVal lvlTransparency As Byte) 'These arrays will hold both image's pixel data Dim imageDataSrc1() As Byte, imageDataSrc2() As Byte, imageDataDst() As Byte 'Coordinate variables Dim x As Long, y As Long 'Image dimensions Dim iWidth As Long, iHeight As Long 'Instantiate a FastDrawing class and gather the first source image's data Dim fDraw As New FastDrawing iWidth = fDraw.GetImageWidth(srcPic1) iHeight = fDraw.GetImageHeight(srcPic1) fDraw.GetImageData2D srcPic1, imageDataSrc1() 'Now do it for the second source image iWidth = fDraw.GetImageWidth(srcPic2) iHeight = fDraw.GetImageHeight(srcPic2) fDraw.GetImageData2D srcPic2, imageDataSrc2() 'Last but not least, do it for the destination picturebox iWidth = fDraw.GetImageWidth(srcPic2) iHeight = fDraw.GetImageHeight(srcPic2) fDraw.GetImageData2D dstPic, imageDataDst() 'These variables will hold temporary pixel color values Dim r As Byte, g As Byte, b As Byte Dim r2 As Byte, g2 As Byte, b2 As Byte 'Build a look-up table to increase speed Dim lookUp(0 To 255, 0 To 255) As Byte Dim invTransparency As Byte invTransparency = 100 - lvlTransparency For x = 0 To 255 For y = 0 To 255 'Mix all possible color values based on simple weighted averaging lookUp(x, y) = CByte(((invTransparency * x) + (lvlTransparency * y)) \ 100) Next y Next x 'Now run a quick loop through the image, adjusting pixel values with the look-up tables Dim quickX As Long For x = 0 To iWidth - 1 quickX = x * 3 For y = 0 To iHeight - 1 'Grab red, green, and blue from the source images r = imageDataSrc1(quickX + 2, y) g = imageDataSrc1(quickX + 1, y) b = imageDataSrc1(quickX, y) r2 = imageDataSrc2(quickX + 2, y) g2 = imageDataSrc2(quickX + 1, y) b2 = imageDataSrc2(quickX, y) 'Use our source values to calculate a new, transparent color imageDataDst(quickX + 2, y) = lookUp(r, r2) imageDataDst(quickX + 1, y) = lookUp(g, g2) imageDataDst(quickX, y) = lookUp(b, b2) Next y Next x 'Draw the new image data to the screen fDraw.SetImageData2D Picture3, iWidth, iHeight, imageDataDst() End Sub ======================= File: Randomize-effects/RandomizationFX.frm ======================= VERSION 5.00 Begin VB.Form frmLineEffect BackColor = &H80000005& Caption = "Line Randomization Effect - www.tannerhelland.com" ClientHeight = 6210 ClientLeft = 60 ClientTop = 645 ClientWidth = 9900 BeginProperty Font Name = "Arial" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty LinkTopic = "Form1" ScaleHeight = 414 ScaleMode = 3 'Pixel ScaleWidth = 660 StartUpPosition = 2 'CenterScreen Begin VB.CommandButton cmdDrawTriangles Caption = "Draw Triangles!" BeginProperty Font Name = "Tahoma" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = 6960 TabIndex = 8 Top = 120 Width = 1695 End Begin VB.CommandButton cmdReset Caption = "Reset" Height = 495 Left = 9000 TabIndex = 7 Top = 120 Width = 735 End Begin VB.TextBox txtLength BeginProperty Font Name = "Arial" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 300 Left = 3600 TabIndex = 6 Text = "40" Top = 240 Width = 1095 End Begin VB.TextBox txtIterations BeginProperty Font Name = "Arial" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 300 Left = 1080 TabIndex = 4 Text = "100000" Top = 240 Width = 1095 End Begin VB.CommandButton cmdDrawLines Appearance = 0 'Flat Caption = "Draw Lines!" BeginProperty Font Name = "Tahoma" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = 5160 TabIndex = 2 Top = 120 Width = 1695 End Begin VB.PictureBox picMain Appearance = 0 'Flat AutoRedraw = -1 'True AutoSize = -1 'True BackColor = &H80000005& FillStyle = 0 'Solid BeginProperty Font Name = "<NAME>" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 5025 Left = 120 ScaleHeight = 333 ScaleMode = 3 'Pixel ScaleWidth = 636 TabIndex = 0 Top = 720 Width = 9570 End Begin VB.PictureBox picBack Appearance = 0 'Flat AutoRedraw = -1 'True AutoSize = -1 'True BackColor = &H80000005& BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 5025 Left = 120 ScaleHeight = 333 ScaleMode = 3 'Pixel ScaleWidth = 636 TabIndex = 1 Top = 720 Visible = 0 'False Width = 9570 End Begin VB.Label Label4 Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "Line Length:" BeginProperty Font Name = "Tahoma" Size = 9.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 255 Left = 2400 TabIndex = 5 Top = 240 Width = 1095 End Begin VB.Label Label3 Appearance = 0 'Flat AutoSize = -1 'True BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "Iterations:" BeginProperty Font Name = "Tahoma" Size = 9.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 240 Left = 120 TabIndex = 3 Top = 240 Width = 885 End Begin VB.Menu mnuFile Caption = "&File" Begin VB.Menu mnuOpenImage Caption = "&Open image" End End End Attribute VB_Name = "frmLineEffect" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False '*************************************************************************** 'Copyright 2018 by <NAME> ' www.tannerhelland.com ' 'Documentation for this project can be found at https://tannerhelland.com/code/ ' 'The source code in this project is licensed under a Simplified BSD license. ' For more information, please review LICENSE.md at https://github.com/tannerhelland/thdc-code/ ' 'If you find this code useful, please consider a small donation to https://www.paypal.me/TannerHelland ' '*************************************************************************** 'Drawing polygons Private Type POINTAPI x As Long y As Long End Type Dim fxTri(0 To 2) As POINTAPI Private Declare Function Polygon Lib "gdi32" (ByVal hdc As Long, lpPoint As POINTAPI, ByVal nCount As Long) As Long Option Explicit 'Draw a cool line effect Private Sub cmdDrawLines_Click() DrawLineEffect picBack, picMain, Val(CLng(txtIterations.Text)), Val(CLng(txtLength.Text)) End Sub 'Draw a cool triangle effect Private Sub cmdDrawTriangles_Click() DrawTriangleEffect picBack, picMain, Val(CLng(txtIterations.Text)), Val(CLng(txtLength.Text)) End Sub 'Reset the foreground image to look like the original image Private Sub cmdReset_Click() Dim fDraw As New FastDrawing Dim ImageData() As Byte Dim iWidth As Long, iHeight As Long iWidth = fDraw.GetImageWidth(Me.picBack) iHeight = fDraw.GetImageHeight(Me.picBack) fDraw.GetImageData2D Me.picBack, ImageData() fDraw.SetImageData2D Me.picMain, iWidth, iHeight, ImageData() End Sub Private Sub Form_Load() 'Draw the initial effect with a default value, then update the image If (App.LogMode = 0) Then Me.Caption = Me.Caption & " - compile for significantly better performance!" LoadImageAutosized App.Path & "\sample.jpg" Me.Show End Sub Private Sub MnuOpenImage_Click() 'Windows common dialog interface Dim cDialog As pdOpenSaveDialog Set cDialog = New pdOpenSaveDialog 'VB6's built-in image loader (which wraps an ancient OLE loader) only supports a 'subset of modern image file types. Dim cdfStr As String cdfStr = "All Compatible Graphics|*.bmp;*.jpg;*.jpeg;*.gif;*.wmf;*.emf|" cdfStr = cdfStr & "BMP - Windows Bitmap|*.bmp|EMF - Enhanced Metafile|*.emf|GIF - Compuserve|*.gif|JPG/JPEG - JFIF Compliant|*.jpg;*.jpeg|WMF - Windows Meta File|*.wmf|All files|*.*" Dim sFile As String If cDialog.GetOpenFileName(sFile,, True, False, cdfStr,,, "Select image",, Me.hWnd) Then LoadImageAutosized sFile End If End Sub 'If a null string is passed, simply paint an unmodified copy of the backbuffer into the foreground buffer Private Sub LoadImageAutosized(Optional ByVal srcFilePath As String = vbNullString) If (LenB(srcFilePath) <> 0) Then picBack.Picture = LoadPicture(srcFilePath) 'Copy the image, automatically resized, from the background picture box to the foreground one Dim fDraw As FastDrawing Set fDraw = New FastDrawing Dim ImageData() As Byte, imgWidth As Long, imgHeight As Long imgWidth = fDraw.GetImageWidth(Me.picBack) imgHeight = fDraw.GetImageHeight(Me.picBack) fDraw.GetImageData2D Me.picBack, ImageData() Me.picMain.Width = imgWidth + 2 Me.picMain.Height = imgHeight + 2 fDraw.SetImageData2D Me.picMain, imgWidth, imgHeight, ImageData() 'Resize the form to automatically contain the new picture box dimensions. '(This performs some sloppy checks to keep the form from resizing larger than the primary display, ' but it is *not* good code - a proper solution would involve the AdjustWindowRect() API or similar!) Dim newWidth As Long, minWidth As Long minWidth = (cmdReset.Left + cmdReset.Width + 20) * Screen.TwipsPerPixelX If (imgWidth < (Screen.Width \ Screen.TwipsPerPixelX) - 50) Then newWidth = (imgWidth + picMain.Left * 4) * Screen.TwipsPerPixelX If (newWidth < minWidth) Then newWidth = minWidth Me.Width = newWidth End If If (imgHeight < (Screen.Height \ Screen.TwipsPerPixelY) - 50) Then Me.Height = (imgHeight + picMain.Top * 3) * Screen.TwipsPerPixelY End Sub 'Apply a cool triangle-draw filter to an image Public Sub DrawTriangleEffect(srcPic As PictureBox, dstPic As PictureBox, Optional numLoops As Long = 10000, Optional lenLine As Long = 50) 'This array will hold the image's pixel data Dim ImageData() As Byte 'This array will hold the new image's pixel data Dim newImageData() As Byte 'Coordinate variables Dim x As Long, y As Long, x2 As Long, y2 As Long, x3 As Long, y3 As Long 'Loop Counter Dim n As Long 'Image dimensions Dim iWidth As Long, iHeight As Long 'Instantiate a FastDrawing class and gather the image's data (into ImageData()) Dim fDraw As New FastDrawing iWidth = fDraw.GetImageWidth(srcPic) iHeight = fDraw.GetImageHeight(srcPic) fDraw.GetImageData2D srcPic, ImageData(), True fDraw.GetImageData2D srcPic, newImageData(), True 'These variables will hold temporary pixel color values Dim r As Long, g As Long, b As Long 'Reset the randomizer Randomize Timer 'These make it faster Dim quickX As Long, quickX2 As Long, quickX3 As Long, lenHalf As Long lenHalf = lenLine \ 2 'Run a quick loop through the image, drawing lines as we go For n = 0 To numLoops 'Generate three random coordinates x = Int(Rnd * iWidth) x2 = Int(Rnd * lenLine) - lenHalf + x If x2 < 0 Then x2 = 0 If x2 > iWidth - 1 Then x2 = iWidth - 1 x3 = Int(Rnd * lenLine) - lenHalf + x If x3 < 0 Then x3 = 0 If x3 > iWidth - 1 Then x3 = iWidth - 1 y = Int(Rnd * iHeight) y2 = Int(Rnd * lenLine) - lenHalf + y If y2 < 0 Then y2 = 0 If y2 > iHeight - 1 Then y2 = iHeight - 1 y3 = Int(Rnd * lenLine) - lenHalf + y If y3 < 0 Then y3 = 0 If y3 > iHeight - 1 Then y3 = iHeight - 1 quickX = x * 3 quickX2 = x2 * 3 quickX3 = x3 * 3 r = ImageData(quickX + 2, y) r = r + ImageData(quickX2 + 2, y2) r = r + ImageData(quickX3 + 2, y3) g = ImageData(quickX + 1, y) g = g + ImageData(quickX2 + 1, y2) g = g + ImageData(quickX3 + 1, y3) b = ImageData(quickX, y) b = b + ImageData(quickX2, y2) b = b + ImageData(quickX3, y3) r = r \ 3 g = g \ 3 b = b \ 3 fxTri(0).x = x fxTri(0).y = y fxTri(1).x = x2 fxTri(1).y = y2 fxTri(2).x = x3 fxTri(2).y = y3 dstPic.FillColor = RGB(r, g, b) dstPic.ForeColor = RGB(r, g, b) Polygon dstPic.hdc, fxTri(0), 3 'dstPic.Line (x, y)-(x2, y2), RGB(R, G, B) If (n And 95) = 0 Then dstPic.Picture = dstPic.Image dstPic.Refresh DoEvents End If Next n dstPic.Picture = dstPic.Image dstPic.Refresh 'Draw the new image data to the screen 'fDraw.SetImageData2D dstPic, iWidth, iHeight, NewImageData() End Sub 'Apply a cool line-draw filter to an image Public Sub DrawLineEffect(srcPic As PictureBox, dstPic As PictureBox, Optional numLoops As Long = 10000, Optional lenLine As Long = 50) 'This array will hold the image's pixel data Dim ImageData() As Byte 'This array will hold the new image's pixel data Dim newImageData() As Byte 'Coordinate variables Dim x As Long, y As Long, x2 As Long, y2 As Long 'Loop Counter Dim n As Long 'Image dimensions Dim iWidth As Long, iHeight As Long 'Instantiate a FastDrawing class and gather the image's data (into ImageData()) Dim fDraw As New FastDrawing iWidth = fDraw.GetImageWidth(srcPic) iHeight = fDraw.GetImageHeight(srcPic) fDraw.GetImageData2D srcPic, ImageData(), True fDraw.GetImageData2D srcPic, newImageData(), True 'These variables will hold temporary pixel color values Dim r As Long, g As Long, b As Long 'Reset the randomizer Randomize Timer 'These make it faster Dim quickX As Long, quickX2 As Long, lenHalf As Long lenHalf = lenLine \ 2 'Run a quick loop through the image, drawing lines as we go For n = 0 To numLoops 'Generate two random coordinates x = Int(Rnd * iWidth) x2 = Int(Rnd * lenLine) - lenHalf + x If x2 < 0 Then x2 = 0 If x2 > iWidth - 1 Then x2 = iWidth - 1 y = Int(Rnd * iHeight) y2 = Int(Rnd * lenLine) - lenHalf + y If y2 < 0 Then y2 = 0 If y2 > iHeight - 1 Then y2 = iHeight - 1 quickX = x * 3 quickX2 = x2 * 3 r = ImageData(quickX + 2, y) r = r + ImageData(quickX2 + 2, y2) g = ImageData(quickX + 1, y) g = g + ImageData(quickX2 + 1, y2) b = ImageData(quickX, y) b = b + ImageData(quickX2, y2) r = r \ 2 g = g \ 2 b = b \ 2 dstPic.Line (x, y)-(x2, y2), RGB(r, g, b) If (n And 95) = 0 Then dstPic.Picture = dstPic.Image dstPic.Refresh DoEvents End If Next n dstPic.Picture = dstPic.Image dstPic.Refresh 'Draw the new image data to the screen 'fDraw.SetImageData2D dstPic, iWidth, iHeight, NewImageData() End Sub 'Convert to absolute byte values (Long-type) Public Sub ByteMe(ByRef TempVar As Long) If TempVar > 255 Then TempVar = 255 If TempVar < 0 Then TempVar = 0 End Sub ======================= File: Blacklight-effect/Blacklight.frm ======================= VERSION 5.00 Begin VB.Form frmBlacklight BackColor = &H80000005& BorderStyle = 1 'Fixed Single Caption = "Blacklight Effect - <EMAIL>" ClientHeight = 5820 ClientLeft = 45 ClientTop = 630 ClientWidth = 6270 BeginProperty Font Name = "Arial" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty HasDC = 0 'False LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 388 ScaleMode = 3 'Pixel ScaleWidth = 418 StartUpPosition = 2 'CenterScreen Begin VB.CheckBox chkEnable Appearance = 0 'Flat BackColor = &H80000005& Caption = "Enable Blacklight Effect" BeginProperty Font Name = "Segoe UI" Size = 9.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 375 Left = 120 TabIndex = 4 Top = 120 Value = 1 'Checked Width = 2295 End Begin VB.HScrollBar hScroll Height = 255 Left = 960 Max = 10 Min = 1 TabIndex = 3 Top = 720 Value = 2 Width = 5175 End Begin VB.PictureBox picMain Appearance = 0 'Flat AutoRedraw = -1 'True BackColor = &H80000005& BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 4530 Left = 120 ScaleHeight = 300 ScaleMode = 3 'Pixel ScaleWidth = 400 TabIndex = 0 Top = 1080 Width = 6030 End Begin VB.PictureBox picBack Appearance = 0 'Flat AutoRedraw = -1 'True AutoSize = -1 'True BackColor = &H80000005& BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 4530 Left = 120 ScaleHeight = 300 ScaleMode = 3 'Pixel ScaleWidth = 400 TabIndex = 1 Top = 1080 Visible = 0 'False Width = 6030 End Begin VB.Label Label1 Appearance = 0 'Flat AutoSize = -1 'True BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "Intensity:" BeginProperty Font Name = "Segoe UI" Size = 9.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 255 Left = 120 TabIndex = 2 Top = 720 Width = 750 End Begin VB.Menu mnuFile Caption = "&File" Begin VB.Menu mnuOpenImage Caption = "&Open image" End End End Attribute VB_Name = "frmBlacklight" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False '*************************************************************************** 'Copyright 2018 by <NAME> ' www.tannerhelland.com ' 'Documentation for this project can be found at https://tannerhelland.com/code/ ' 'The source code in this project is licensed under a Simplified BSD license. ' For more information, please review LICENSE.md at https://github.com/tannerhelland/thdc-code/ ' 'If you find this code useful, please consider a small donation to https://www.paypal.me/TannerHelland ' '*************************************************************************** Option Explicit Private Sub chkEnable_Click() 'Toggle the effect If (chkEnable.Value = vbChecked) Then UpdateEffect Else LoadImageAutosized vbNullString End Sub Private Sub Form_Load() 'Draw the initial effect with a default value, then update the image If (App.LogMode = 0) Then Me.Caption = Me.Caption & " - compile for significantly better performance!" LoadImageAutosized App.Path & "\sample.jpg" UpdateEffect Me.Show End Sub 'When the blacklight intensity is changed, redraw the image effect (if it's enabled) Private Sub hScroll_Change() UpdateEffect End Sub Private Sub hScroll_Scroll() UpdateEffect End Sub Private Sub MnuOpenImage_Click() 'Windows common dialog interface Dim cDialog As pdOpenSaveDialog Set cDialog = New pdOpenSaveDialog 'VB6's built-in image loader (which wraps an ancient OLE loader) only supports a 'subset of modern image file types. Dim cdfStr As String cdfStr = "All Compatible Graphics|*.bmp;*.jpg;*.jpeg;*.gif;*.wmf;*.emf|" cdfStr = cdfStr & "BMP - Windows Bitmap|*.bmp|EMF - Enhanced Metafile|*.emf|GIF - Compuserve|*.gif|JPG/JPEG - JFIF Compliant|*.jpg;*.jpeg|WMF - Windows Meta File|*.wmf|All files|*.*" Dim sFile As String If cDialog.GetOpenFileName(sFile,, True, False, cdfStr,,, "Select image",, Me.hWnd) Then 'Load the image and refresh the effect LoadImageAutosized sFile UpdateEffect End If End Sub 'If a null string is passed, simply paint an unmodified copy of the backbuffer into the foreground buffer Private Sub LoadImageAutosized(Optional ByVal srcFilePath As String = vbNullString) If (LenB(srcFilePath) <> 0) Then picBack.Picture = LoadPicture(srcFilePath) 'Copy the image, automatically resized, from the background picture box to the foreground one Dim fDraw As FastDrawing Set fDraw = New FastDrawing Dim ImageData() As Byte, imgWidth As Long, imgHeight As Long imgWidth = fDraw.GetImageWidth(Me.picBack) imgHeight = fDraw.GetImageHeight(Me.picBack) fDraw.GetImageData2D Me.picBack, ImageData() Me.picMain.Width = imgWidth + 2 Me.picMain.Height = imgHeight + 2 fDraw.SetImageData2D Me.picMain, imgWidth, imgHeight, ImageData() 'Resize the form to automatically contain the new picture box dimensions. '(This performs some sloppy checks to keep the form from resizing larger than the primary display, ' but it is *not* good code - a proper solution would involve the AdjustWindowRect() API or similar!) Dim newWidth As Long, minWidth As Long minWidth = (hScroll.Left + hScroll.Width + 20) * Screen.TwipsPerPixelX If (imgWidth < (Screen.Width \ Screen.TwipsPerPixelX) - 50) Then newWidth = (imgWidth + picMain.Left * 4) * Screen.TwipsPerPixelX If (newWidth < minWidth) Then newWidth = minWidth Me.Width = newWidth End If If (imgHeight < (Screen.Height \ Screen.TwipsPerPixelY) - 50) Then Me.Height = (imgHeight + picMain.Top * 2) * Screen.TwipsPerPixelY End Sub Private Sub UpdateEffect() If (chkEnable.Value = vbChecked) Then DrawBlacklight picBack, picMain, hScroll.Value End Sub 'This is the core Blacklight function Public Sub DrawBlacklight(ByRef srcPic As PictureBox, ByRef dstPic As PictureBox, Optional ByVal fxWeight As Long = 2) 'Coordinates, dimensions, and pixel data Dim x As Long, y As Long, imgWidth As Long, imgHeight As Long, imgPixels() As Byte 'Instantiate a FastDrawing class and gather the image's data (into imgpixels()) Dim fDraw As New FastDrawing imgWidth = fDraw.GetImageWidth(srcPic) imgHeight = fDraw.GetImageHeight(srcPic) fDraw.GetImageData2D srcPic, imgPixels() 'These variables will hold temporary pixel color values Dim r As Long, g As Long, b As Long, l As Long 'Run a quick loop through the image, adjusting pixel values as we go Dim xStride As Long For y = 0 To imgHeight - 1 For x = 0 To imgWidth - 1 xStride = x * 3 'Windows DIBs are always in BGR order b = imgPixels(xStride, y) g = imgPixels(xStride + 1, y) r = imgPixels(xStride + 2, y) 'Calculate luminance. (R + G + B) / 3 would also work. l = (222 * r + 707 * g + 71 * b) \ 1000 'The blacklight effect is pretty simple! r = Abs(r - l) * fxWeight g = Abs(g - l) * fxWeight b = Abs(b - l) * fxWeight If (r > 255) Then r = 255 If (g > 255) Then g = 255 If (b > 255) Then b = 255 'Assign the new pixel values imgPixels(xStride, y) = b imgPixels(xStride + 1, y) = g imgPixels(xStride + 2, y) = r Next x Next y 'Draw the new image data to the screen fDraw.SetImageData2D dstPic, imgWidth, imgHeight, imgPixels() End Sub ======================= File: Edge-detection/EdgeDetection.frm ======================= <filename>Edge-detection/EdgeDetection.frm VERSION 5.00 Begin VB.Form frmEdgeDetection BackColor = &H80000005& BorderStyle = 1 'Fixed Single Caption = "Edge Detection Algorithms - www.tannerhelland.com" ClientHeight = 7905 ClientLeft = 45 ClientTop = 630 ClientWidth = 6270 BeginProperty Font Name = "Arial" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 527 ScaleMode = 3 'Pixel ScaleWidth = 418 StartUpPosition = 2 'CenterScreen Begin VB.CommandButton cmdReset Appearance = 0 'Flat Caption = "Reset the Image" BeginProperty Font Name = "Arial" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = 120 TabIndex = 5 Top = 2640 Width = 6015 End Begin VB.Frame frmDescription Appearance = 0 'Flat BackColor = &H80000005& Caption = "Description:" BeginProperty Font Name = "Arial" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 2415 Left = 2880 TabIndex = 3 Top = 120 Width = 3255 Begin VB.Label lblDesc Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent BeginProperty Font Name = "Courier New" Size = 9.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 2055 Left = 120 TabIndex = 4 Top = 240 Width = 3015 End End Begin VB.ListBox lstEdgeOptions Appearance = 0 'Flat BeginProperty Font Name = "Arial" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 2280 Left = 120 TabIndex = 2 Top = 240 Width = 2655 End Begin VB.PictureBox picMain Appearance = 0 'Flat AutoRedraw = -1 'True BackColor = &H80000005& BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 4530 Left = 120 ScaleHeight = 300 ScaleMode = 3 'Pixel ScaleWidth = 400 TabIndex = 0 Top = 3240 Width = 6030 End Begin VB.PictureBox picBack Appearance = 0 'Flat AutoRedraw = -1 'True AutoSize = -1 'True BackColor = &H80000005& BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 4530 Left = 120 ScaleHeight = 300 ScaleMode = 3 'Pixel ScaleWidth = 400 TabIndex = 1 Top = 3240 Visible = 0 'False Width = 6030 End Begin VB.Menu mnuFile Caption = "&File" Begin VB.Menu mnuOpenImage Caption = "&Open image" End End End Attribute VB_Name = "frmEdgeDetection" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False '*************************************************************************** 'Copyright 2018 by <NAME> ' www.tannerhelland.com ' 'Documentation for this project can be found at https://tannerhelland.com/code/ ' 'The source code in this project is licensed under a Simplified BSD license. ' For more information, please review LICENSE.md at https://github.com/tannerhelland/thdc-code/ ' 'If you find this code useful, please consider a small donation to https://www.paypal.me/TannerHelland ' '*************************************************************************** Option Explicit 'FM() is our Filter Matrix - look at individual edge filters to see how this works Private FM() As Long 'Reset the foreground image to look like the original image Private Sub cmdReset_Click() LoadImageAutosized vbNullString End Sub 'Populate the possible edge detection routines Private Sub Form_Load() lstEdgeOptions.Clear lstEdgeOptions.AddItem "Prewitt Horizontal" lstEdgeOptions.AddItem "Prewitt Vertical" lstEdgeOptions.AddItem "Sobel Horizontal" lstEdgeOptions.AddItem "Sobel Vertical" lstEdgeOptions.AddItem "Laplacian" lstEdgeOptions.AddItem "Hilite" lstEdgeOptions.AddItem "Helland Linear" lstEdgeOptions.AddItem "Helland Cubic" lblDesc = "Matrix:" & vbCrLf & vbCrLf & "-1 0 1" & vbCrLf & "-1 0 1" & vbCrLf & "-1 0 1" 'Draw the initial effect with a default value, then update the image If (App.LogMode = 0) Then Me.Caption = Me.Caption & " - compile for significantly better performance!" LoadImageAutosized App.Path & "\sample.jpg" lstEdgeOptions.ListIndex = 0 Me.Show End Sub 'When an edge detection routine is selected, run it and display its corresponding matrix in the label on the main form Private Sub lstEdgeOptions_Click() Dim l As String l = lstEdgeOptions.List(lstEdgeOptions.ListIndex) 'Prewitt Horizontal If l = "Prewitt Horizontal" Then lblDesc = "Matrix:" & vbCrLf & vbCrLf & "-1 0 1" & vbCrLf & "-1 0 1" & vbCrLf & "-1 0 1" ReDim FM(-1 To 1, -1 To 1) As Long FM(-1, -1) = -1 FM(-1, 0) = -1 FM(-1, 1) = -1 FM(1, -1) = 1 FM(1, 0) = 1 FM(1, 1) = 1 DoFilter Me.picBack, Me.picMain, 3, 1, 0, True ElseIf l = "Prewitt Vertical" Then lblDesc = "Matrix:" & vbCrLf & vbCrLf & "-1 -1 -1" & vbCrLf & " 0 0 0" & vbCrLf & " 1 1 1" ReDim FM(-1 To 1, -1 To 1) As Long FM(-1, -1) = 1 FM(0, -1) = 1 FM(1, -1) = 1 FM(-1, 1) = -1 FM(0, 1) = -1 FM(1, 1) = -1 DoFilter Me.picBack, Me.picMain, 3, 1, 0, True ElseIf l = "Sobel Horizontal" Then lblDesc = "Matrix:" & vbCrLf & vbCrLf & "-1 0 1" & vbCrLf & "-2 0 2" & vbCrLf & "-1 0 1" ReDim FM(-1 To 1, -1 To 1) As Long FM(-1, -1) = -1 FM(-1, 0) = -2 FM(-1, 1) = -1 FM(1, -1) = 1 FM(1, 0) = 2 FM(1, 1) = 1 DoFilter Me.picBack, Me.picMain, 3, 1, 0, True ElseIf l = "Sobel Vertical" Then lblDesc = "Matrix:" & vbCrLf & vbCrLf & "-1 -2 -1" & vbCrLf & " 0 0 0" & vbCrLf & " 1 2 1" ReDim FM(-1 To 1, -1 To 1) As Long FM(-1, -1) = 1 FM(0, -1) = 2 FM(1, -1) = 1 FM(-1, 1) = -1 FM(0, 1) = -2 FM(1, 1) = -1 DoFilter Me.picBack, Me.picMain, 3, 1, 0, True ElseIf l = "Laplacian" Then lblDesc = "Matrix:" & vbCrLf & vbCrLf & " 0 -1 0" & vbCrLf & "-1 4 -1" & vbCrLf & " 0 -1 0" ReDim FM(-1 To 1, -1 To 1) As Long FM(-1, 0) = -1 FM(0, -1) = -1 FM(0, 1) = -1 FM(1, 0) = -1 FM(0, 0) = 4 DoFilter Me.picBack, Me.picMain, 3, 1, 0, True ElseIf l = "Hilite" Then lblDesc = "Matrix:" & vbCrLf & vbCrLf & "-4 -2 -1" & vbCrLf & "-2 10 0" & vbCrLf & "-1 0 0" ReDim FM(-1 To 1, -1 To 1) As Long FM(-1, -1) = -4 FM(-1, 0) = -2 FM(0, -1) = -2 FM(1, -1) = -1 FM(-1, 1) = -1 FM(0, 0) = 10 DoFilter Me.picBack, Me.picMain, 3, 1, 0, True ElseIf l = "Helland Linear" Then lblDesc = "Matrix:" & vbCrLf & vbCrLf & "-1 0 -1" & vbCrLf & " 0 4 0" & vbCrLf & "-1 0 -1" ReDim FM(-1 To 1, -1 To 1) As Long FM(-1, -1) = -1 FM(-1, 1) = -1 FM(1, -1) = -1 FM(1, 1) = -1 FM(0, 0) = 4 DoFilter Me.picBack, Me.picMain, 3, 1, 0, True Else lblDesc = "Matrix:" & vbCrLf & vbCrLf & " 0 0 0 1 0" & vbCrLf & " 1 0 0 0 0" & vbCrLf & " 0 0 -4 0 0" & vbCrLf & " 0 0 0 0 1" & vbCrLf & " 0 1 0 0 0" ReDim FM(-2 To 2, -2 To 2) As Long FM(-1, -2) = 1 FM(-2, 1) = 1 FM(1, 2) = 1 FM(2, -1) = 1 FM(0, 0) = -4 DoFilter Me.picBack, Me.picMain, 5, 1, 0, True End If End Sub Private Sub MnuOpenImage_Click() 'Windows common dialog interface Dim cDialog As pdOpenSaveDialog Set cDialog = New pdOpenSaveDialog 'VB6's built-in image loader (which wraps an ancient OLE loader) only supports a 'subset of modern image file types. Dim cdfStr As String cdfStr = "All Compatible Graphics|*.bmp;*.jpg;*.jpeg;*.gif;*.wmf;*.emf|" cdfStr = cdfStr & "BMP - Windows Bitmap|*.bmp|EMF - Enhanced Metafile|*.emf|GIF - Compuserve|*.gif|JPG/JPEG - JFIF Compliant|*.jpg;*.jpeg|WMF - Windows Meta File|*.wmf|All files|*.*" Dim sFile As String If cDialog.GetOpenFileName(sFile,, True, False, cdfStr,,, "Select image",, Me.hWnd) Then 'Load the image and refresh the effect LoadImageAutosized sFile lstEdgeOptions_Click End If End Sub 'If a null string is passed, simply paint an unmodified copy of the backbuffer into the foreground buffer Private Sub LoadImageAutosized(Optional ByVal srcFilePath As String = vbNullString) If (LenB(srcFilePath) <> 0) Then picBack.Picture = LoadPicture(srcFilePath) 'Copy the image, automatically resized, from the background picture box to the foreground one Dim fDraw As FastDrawing Set fDraw = New FastDrawing Dim imageData() As Byte, imgWidth As Long, imgHeight As Long imgWidth = fDraw.GetImageWidth(Me.picBack) imgHeight = fDraw.GetImageHeight(Me.picBack) fDraw.GetImageData2D Me.picBack, imageData() Me.picMain.Width = imgWidth + 2 Me.picMain.Height = imgHeight + 2 fDraw.SetImageData2D Me.picMain, imgWidth, imgHeight, imageData() 'Resize the form to automatically contain the new picture box dimensions. '(This performs some sloppy checks to keep the form from resizing larger than the primary display, ' but it is *not* good code - a proper solution would involve the AdjustWindowRect() API or similar!) Dim newWidth As Long, minWidth As Long minWidth = (frmDescription.Left + frmDescription.Width + 20) * Screen.TwipsPerPixelX If (imgWidth < (Screen.Width \ Screen.TwipsPerPixelX) - 50) Then newWidth = (imgWidth + picMain.Left * 4) * Screen.TwipsPerPixelX If (newWidth < minWidth) Then newWidth = minWidth Me.Width = newWidth End If If (imgHeight < (Screen.Height \ Screen.TwipsPerPixelY) - 50) Then Me.Height = (imgHeight + picMain.TOp * 1.3) * Screen.TwipsPerPixelY End Sub 'The omnipotent DoFilter routine - it takes whatever is in FM() and applies it to the image Public Sub DoFilter(ByRef srcPic As PictureBox, ByRef dstPic As PictureBox, ByVal filterSize As Long, ByVal filterWeight As Long, ByVal filterBias As Long, Optional ByVal invertResult As Boolean = False) 'This array will hold the image's original pixel data Dim imageData() As Byte 'tData holds the calculated values of the filter (as opposed to the original values) Dim tData() As Byte 'Coordinate variables Dim x As Long, Y As Long 'Image dimensions Dim iWidth As Long, iHeight As Long 'Instantiate a FastDrawing class and gather the image's data (into ImageData()) Dim fDraw As New FastDrawing iWidth = fDraw.GetImageWidth(srcPic) - 1 iHeight = fDraw.GetImageHeight(srcPic) - 1 fDraw.GetImageData2D srcPic, imageData() fDraw.GetImageData2D srcPic, tData() 'We only do this so that tData() is sized appropriately 'These variables will hold temporary pixel color values Dim r As Long, g As Long, b As Long 'C and D are like X and Y - they are additional loop variables used for sub-loops Dim c As Long, d As Long 'CalcX and CalcY are temporary width and height values for sub-loops Dim calcX As Long, calcY As Long 'CalcVar determines the size of each sub-loop Dim calcVar As Long calcVar = (filterSize \ 2) 'TempRef is like QuickX below, but for sub-loops Dim tempRef As Long 'FilterWeightTemp will be reset for every pixel, and decremented appropriately if 'attempting to calculate the value for a pixel outside the perimeter of the image Dim filterWeightTemp As Long 'Now that we're ready, run a quick loop through the image, calculating pixel values as we go Dim quickX As Long For x = 0 To iWidth quickX = x * 3 For Y = 0 To iHeight 'Reset red, green, and blue r = 0 g = 0 b = 0 filterWeightTemp = filterWeight 'Run a sub-loop around this pixel For c = x - calcVar To x + calcVar tempRef = c * 3 For d = Y - calcVar To Y + calcVar calcX = c - x calcY = d - Y 'If no filter value is being applied to this pixel, ignore it (GoTo's aren't generally a part of good programming, but they ARE convenient :) If FM(calcX, calcY) = 0 Then GoTo 7 'If this pixel lies outside the image perimeter, ignore it and adjust FilterWeight accordingly If c < 0 Or d < 0 Or c > iWidth Or d > iHeight Then filterWeightTemp = filterWeight - FM(calcX, calcY) GoTo 7 End If 'Adjust red, green, and blue according to the values in the filter matrix (FM) r = r + (imageData(tempRef + 2, d) * FM(calcX, calcY)) g = g + (imageData(tempRef + 1, d) * FM(calcX, calcY)) b = b + (imageData(tempRef, d) * FM(calcX, calcY)) 7 Next d Next c 'If a weight has been set, apply it now If filterWeight <> 1 Then r = r \ filterWeightTemp g = g \ filterWeightTemp b = b \ filterWeightTemp End If 'If a bias has been specified, apply it now If filterBias <> 0 Then r = r + filterBias g = g + filterBias b = b + filterBias End If 'Make sure all values are between 0 and 255 ByteMe r ByteMe g ByteMe b 'If inversion is specified, apply it now If invertResult Then r = 255 - r g = 255 - g b = 255 - b End If 'Finally, remember the new value in our tData array tData(quickX, Y) = CByte(b) tData(quickX + 1, Y) = CByte(g) tData(quickX + 2, Y) = CByte(r) Next Y Next x 'Draw the new image data to the screen fDraw.SetImageData2D dstPic, iWidth + 1, iHeight + 1, tData() End Sub 'Convert to absolute byte values (Long-type) Public Sub ByteMe(ByRef tempVar As Long) If (tempVar > 255) Then tempVar = 255 If (tempVar < 0) Then tempVar = 0 End Sub ======================= File: Fire-effect/frmFire.frm ======================= VERSION 5.00 Begin VB.Form frmFire Appearance = 0 'Flat BackColor = &H80000005& Caption = "Even Faster Real-Time Fire Effect - www.tannerhelland.com" ClientHeight = 4380 ClientLeft = 60 ClientTop = 345 ClientWidth = 7965 BeginProperty Font Name = "Arial" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Icon = "frmFire.frx":0000 LinkTopic = "Form1" ScaleHeight = 292 ScaleMode = 3 'Pixel ScaleWidth = 531 StartUpPosition = 2 'CenterScreen Begin VB.HScrollBar hsBlue Height = 255 Left = 840 Max = 300 TabIndex = 16 Top = 1800 Value = 50 Width = 6975 End Begin VB.HScrollBar hsGreen Height = 255 Left = 840 Max = 300 TabIndex = 15 Top = 1440 Value = 100 Width = 6975 End Begin VB.HScrollBar hsRed Height = 255 Left = 840 Max = 300 TabIndex = 14 Top = 1080 Value = 200 Width = 6975 End Begin VB.HScrollBar scrUniformity Height = 255 Left = 3840 Max = 3 TabIndex = 10 Top = 120 Value = 2 Width = 1695 End Begin VB.TextBox txtHeight Appearance = 0 'Flat BeginProperty Font Name = "Arial" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 285 Left = 2160 TabIndex = 4 Text = "128" Top = 120 Width = 495 End Begin VB.TextBox txtWidth Appearance = 0 'Flat BeginProperty Font Name = "Arial" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 285 Left = 720 TabIndex = 3 Text = "512" Top = 120 Width = 495 End Begin VB.CommandButton cmdStop Appearance = 0 'Flat Caption = "Stop Fire" Height = 375 Left = 6240 TabIndex = 2 Top = 600 Width = 1575 End Begin VB.CommandButton cmdStart Appearance = 0 'Flat Caption = "Start Fire" Height = 375 Left = 4440 TabIndex = 1 Top = 600 Width = 1575 End Begin VB.PictureBox picDest Appearance = 0 'Flat BackColor = &H00000000& ClipControls = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty FontTransparent = 0 'False ForeColor = &H80000008& Height = 1950 Left = 120 ScaleHeight = 128 ScaleMode = 3 'Pixel ScaleWidth = 512 TabIndex = 0 ToolTipText = "Here's your flame!" Top = 2280 Width = 7710 End Begin VB.Label Label6 Appearance = 0 'Flat AutoSize = -1 'True BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "Blue:" BeginProperty Font Name = "Arial" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 225 Left = 120 TabIndex = 13 Top = 1800 Width = 420 End Begin VB.Label Label4 Appearance = 0 'Flat AutoSize = -1 'True BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "Green:" BeginProperty Font Name = "Arial" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 225 Left = 120 TabIndex = 12 Top = 1440 Width = 555 End Begin VB.Label Label2 Appearance = 0 'Flat AutoSize = -1 'True BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "Red:" BeginProperty Font Name = "Arial" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 225 Left = 120 TabIndex = 11 Top = 1080 Width = 390 End Begin VB.Label Label7 BackStyle = 0 'Transparent Caption = "Note: changes will not take place until the fire is restarted." ForeColor = &H000000FF& Height = 255 Left = 120 TabIndex = 9 Top = 720 Width = 4215 End Begin VB.Label lblFrameRate Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "Frame Rate..." BeginProperty Font Name = "Arial" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 255 Left = 5760 TabIndex = 8 Top = 120 Width = 1335 End Begin VB.Label Label1 BackStyle = 0 'Transparent Caption = "Width:" BeginProperty Font Name = "Arial" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 255 Left = 120 TabIndex = 7 Top = 120 Width = 615 End Begin VB.Label Label3 BackStyle = 0 'Transparent Caption = "Height:" BeginProperty Font Name = "Arial" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 255 Left = 1440 TabIndex = 6 Top = 120 Width = 615 End Begin VB.Label Label5 Appearance = 0 'Flat AutoSize = -1 'True BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "Uniformity:" BeginProperty Font Name = "Arial" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 225 Left = 2880 TabIndex = 5 Top = 120 Width = 870 End End Attribute VB_Name = "frmFire" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False '*************************************************************************** 'Copyright 2018 by <NAME> ' www.tannerhelland.com ' 'Documentation for this project can be found at https://tannerhelland.com/code/ ' 'The source code in this project is licensed under a Simplified BSD license. ' For more information, please review LICENSE.md at https://github.com/tannerhelland/thdc-code/ ' 'If you find this code useful, please consider a small donation to https://www.paypal.me/TannerHelland ' '*************************************************************************** 'API: 'BitBlt for blitting the fire from the buffer to the screen Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long 'Pixel routines; faster then PSet and Point but not as fast as GetDIBits, StretchDIBits Private Declare Function SetPixelV Lib "gdi32" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Byte Private Declare Function GetPixel Lib "gdi32" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long) As Long 'High performance timer functions Private Declare Function QueryPerformanceFrequency Lib "kernel32" (ByRef lpFrequency As Currency) As Long Private Declare Function QueryPerformanceCounter Lib "kernel32" (ByRef lpPerformanceCount As Currency) As Long 'Values for tracking function times Private curFreq As Currency, curStart As Currency, curEnd As Currency 'Whether or not to run the flames Private Engage As Boolean 'How many frames have elapsed since the program began Private frameCount As Long 'Pressing the START button initializes the screen and calls the DrawFastFlames() routine Private Sub cmdStart_Click() 'First, clear the picture boxes picDest.Picture = LoadPicture(vbNullString) picDest.Refresh 'Collect the width and height values of the flame effect Dim tempX As Long, tempY As Long tempX = Val(txtWidth) tempY = Val(txtHeight) 'Resize the picture boxes to match (and add two pixels for the borders of the picture box (1 pixel each)) picDest.Width = tempX + 2 picDest.Height = tempY + 2 'Determine the resolution of this system's high performance timer QueryPerformanceFrequency curFreq 'Set the "engage" parameter to true and call the fire function frameCount = 0 Engage = True DrawFastFlames picDest, tempX, tempY, CSng(hsRed) / 100!, CSng(hsGreen) / 100!, CSng(hsBlue) / 100!, scrUniformity.Value End Sub 'When STOP is pressed, disengage the fire routine Private Sub cmdStop_Click() Engage = False End Sub 'This routine draws a cool fire effect using the specified parameters Private Sub DrawFastFlames(dstPic As PictureBox, ByVal flameWidth As Long, ByVal flameHeight As Long, ByVal redModifier As Single, ByVal greenModifier As Single, ByVal blueModifier As Single, Optional ByVal Uniformity As Byte = 2) 'This array holds all the individual flame pixels Dim FlameArray() As Long ReDim FlameArray(0 To flameWidth, 0 To flameHeight) As Long 'How much of the flames to reheat after each drawing (typically the bottom 10% of the array) Dim FillVal As Long FillVal = flameHeight * 0.9 'This will temporarily hold the value of each flame pixel Dim curPixel As Long 'As much as I hate an arbitrary name like "temp", that's what we'll use this for Dim tmpValue As Long 'Loop variables Dim x As Long, y As Long 'This is used to generate an RGB() value for the flame's color Static Color As Long 'Look-up tables for each color (faster than generating them on the fly) Dim Red(0 To 255) As Byte Dim Green(0 To 255) As Byte Dim Blue(0 To 255) As Byte For x = 0 To 255 Red(x) = ByteMe(x * redModifier) Green(x) = ByteMe(x * greenModifier) Blue(x) = ByteMe(x * blueModifier) Next x 'Used to calculate FPS Dim curTime As Single 'NEW! DIB Section code 'This array will hold the image's pixel data Dim imageData() As Byte 'Depending on VB quirks, the DIB array may or may not be the same size 'as the scalewidth/scaleheight properties Dim iWidth As Long, iHeight As Long Dim tmpX As Long, tmpY As Long 'Instantiate a FastDrawing class and gather the image's data (into ImageData()) Dim fDraw As New FastDrawing iWidth = fDraw.GetImageWidth(picDest) iHeight = fDraw.GetImageHeight(picDest) fDraw.GetImageData2D picDest, imageData() 'Uniformity is a somewhat arbitrary measurement; basically, I use it to control how 'random the flames vertical growth is. The initial number passed into this function 'should lie between 0 and 3 Uniformity = 5 - Uniformity 'Before starting, randomize the seed for VB's built-in Randomize function Randomize Timer 'If engaged, draw the flames! Do While Engage 'Remember the current time (for calculating FPS at the end of the loop) QueryPerformanceCounter curStart 'Run a loop through the flames from the bottom up... For y = 2 To flameHeight '...and from right-to-left For x = 0 To flameWidth 'Grab the current flame pixel curPixel = FlameArray(x, y) 'If this pixel is dim enough, ignore it for sake of uniformity If curPixel < Uniformity Then GoTo 1 'Give this pixel a random degree of cooldown tmpValue = Int(Rnd * Uniformity) FlameArray(x, y) = curPixel - tmpValue 'In addition, move this pixel upward tmpY = y - tmpValue If tmpY < 0 Then tmpY = 0 FlameArray(x, tmpY) = FlameArray(x, y) 'Generate a color based on the "heat" value Color = (FlameArray(x, y) * 255) \ flameHeight 'To improve speed, randomize the x movement of every 5th pixel '(as opposed to doing it for every pixel) If ((x + y) And 3) = 0 Then tmpX = (x + Int(Rnd * 2)) * 3 Else tmpX = x * 3 End If 'Draw this flame pixel using a cool flame-colored formula (based upon 'the values passed into this function) If tmpX <= (iWidth * 3) - 3 Then tmpY = flameHeight - y If tmpY < 0 Then tmpY = 0 imageData(tmpX, tmpY) = Blue(Color) imageData(tmpX + 1, tmpY) = Green(Color) imageData(tmpX + 2, tmpY) = Red(Color) End If 1 Next x Next y 'Once all flames are processed, make the bottom 4 rows hot again For y = FillVal To flameHeight For x = 0 To flameWidth FlameArray(x, y) = flameHeight Next x Next y 'Copy the whole flame image from the buffer to the viewable picture box fDraw.SetImageData2D dstPic, iWidth, iHeight, imageData() 'Calculate an exact framerate and display it QueryPerformanceCounter curEnd lblFrameRate.Caption = Int(1 / ((curEnd - curStart) / curFreq)) & " FPS" 'Every 32 frames, halt for external events (keypresses, mouse movement, etc.) frameCount = frameCount + 1 If (frameCount And 31) Then DoEvents 'Do it all over again! Loop End Sub 'When the form is closed, make sure the flame function is disengaged Private Sub Form_Unload(Cancel As Integer) Engage = False End Sub 'This simple little function ensure that the variable it receives falls within the ' proper byte range (0-255) Private Function ByteMe(ByVal toByte As Long) As Byte If (toByte > 255) Then ByteMe = 255 ElseIf (toByte < 0) Then ByteMe = 0 Else ByteMe = toByte End If End Function ======================= File: Levels-effect/Histogram.frm ======================= <gh_stars>10-100 VERSION 5.00 Begin VB.Form frmHistogram AutoRedraw = -1 'True BackColor = &H00C0C0C0& BorderStyle = 4 'Fixed ToolWindow Caption = " Histogram" ClientHeight = 6810 ClientLeft = 13200 ClientTop = 2805 ClientWidth = 4125 BeginProperty Font Name = "Arial" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 454 ScaleMode = 3 'Pixel ScaleWidth = 275 ShowInTaskbar = 0 'False Begin VB.Frame Frame1 BackColor = &H00C0C0C0& Caption = "Statistics" Height = 1455 Left = 120 TabIndex = 6 Top = 5280 Width = 3855 Begin VB.Label lblMaxCount Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent ForeColor = &H80000008& Height = 255 Left = 1320 TabIndex = 13 Top = 1080 Width = 2415 End Begin VB.Label Label5 Appearance = 0 'Flat AutoSize = -1 'True BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "Maximum count:" ForeColor = &H80000008& Height = 210 Left = 120 TabIndex = 12 Top = 1080 Width = 1155 End Begin VB.Label lblCount Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent ForeColor = &H80000008& Height = 255 Left = 600 TabIndex = 11 Top = 840 Width = 3135 End Begin VB.Label Label4 Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "Count:" ForeColor = &H80000008& Height = 255 Left = 120 TabIndex = 10 Top = 840 Width = 495 End Begin VB.Label lblLevel Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent ForeColor = &H80000008& Height = 255 Left = 600 TabIndex = 9 Top = 600 Width = 3135 End Begin VB.Line Line1 X1 = 120 X2 = 3720 Y1 = 530 Y2 = 530 End Begin VB.Label Label3 Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "Level:" ForeColor = &H80000008& Height = 255 Left = 120 TabIndex = 8 Top = 600 Width = 495 End Begin VB.Label lblTotalPixels Appearance = 0 'Flat AutoSize = -1 'True BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "Total pixels:" ForeColor = &H80000008& Height = 210 Left = 120 TabIndex = 7 Top = 240 Width = 855 End End Begin VB.PictureBox picGradient Appearance = 0 'Flat AutoRedraw = -1 'True BackColor = &H80000005& ForeColor = &H80000008& Height = 255 Left = 120 ScaleHeight = 15 ScaleMode = 3 'Pixel ScaleWidth = 256 TabIndex = 5 Top = 4950 Width = 3870 End Begin VB.ComboBox cmbHistSource Appearance = 0 'Flat Height = 330 Left = 1560 TabIndex = 2 Top = 120 Width = 2415 End Begin VB.ComboBox cmbHistMethod Appearance = 0 'Flat Height = 330 Left = 1560 TabIndex = 1 Top = 480 Width = 2415 End Begin VB.PictureBox picH Appearance = 0 'Flat AutoRedraw = -1 'True BackColor = &H80000005& ForeColor = &H80000008& Height = 3975 Left = 120 MousePointer = 2 'Cross ScaleHeight = 263 ScaleMode = 3 'Pixel ScaleWidth = 256 TabIndex = 0 Top = 960 Width = 3870 End Begin VB.Label Label2 Appearance = 0 'Flat AutoSize = -1 'True BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "Drawing Method:" ForeColor = &H80000008& Height = 210 Left = 120 TabIndex = 4 Top = 540 Width = 1230 End Begin VB.Label Label1 Appearance = 0 'Flat AutoSize = -1 'True BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "Histogram Source:" ForeColor = &H80000008& Height = 210 Left = 120 TabIndex = 3 Top = 180 Width = 1335 End End Attribute VB_Name = "frmHistogram" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False '*************************************************************************** 'Copyright 2018 by <NAME> ' www.tannerhelland.com ' 'Documentation for this project can be found at https://tannerhelland.com/code/ ' 'The source code in this project is licensed under a Simplified BSD license. ' For more information, please review LICENSE.md at https://github.com/tannerhelland/thdc-code/ ' 'If you find this code useful, please consider a small donation to https://www.paypal.me/TannerHelland ' '*************************************************************************** Option Explicit 'Throughout this form, the following array locations refer to a type of histogram: '0 - Red '1 - Green '2 - Blue '3 - Luminance 'This applies especially to the hData() and hMax() arrays 'Histogram data for each particular type (r/g/b/luminance) Dim hData(0 To 3, 0 To 255) As Single 'Maximum histogram values (r/g/b/luminance) Dim hMax(0 To 3) As Single 'Loop and position variables Dim x As Long, y As Long 'When either combo box is used, remember what was selected and then draw the new 'histogram Private Sub cmbHistMethod_Click() lastHistMethod = cmbHistMethod.ListIndex DrawHistogram cmbHistSource.ListIndex, cmbHistMethod.ListIndex End Sub Private Sub cmbHistSource_Click() lastHistSource = cmbHistSource.ListIndex DrawHistogram cmbHistSource.ListIndex, cmbHistMethod.ListIndex End Sub 'Generate the histogram data upon form load (we only need to do it once per image) Private Sub Form_Load() GenerateHistogram 'Clear out the combo box that displays histogram sources and fill it with 'appropriate choices cmbHistSource.Clear cmbHistSource.AddItem "Red" cmbHistSource.AddItem "Green" cmbHistSource.AddItem "Blue" cmbHistSource.AddItem "Luminance" 'Set the current combo box option to be whatever we used last cmbHistSource.ListIndex = lastHistSource 'Clear out the combo box that displays histogram drawing methods and fill it 'with appropriate choices cmbHistMethod.Clear cmbHistMethod.AddItem "Connecting lines" cmbHistMethod.AddItem "Solid bars" 'Set the current combo box option to be whatever we used last cmbHistMethod.ListIndex = lastHistMethod End Sub 'Subroutine to draw a histogram. hType tells us what histogram to draw: '0 - Red '1 - Green '2 - Blue '3 - Luminance 'drawMethod tells us what kind of histogram to draw: '0 - Connected lines (like a line graph) '1 - Solid bars (like a bar graph) Private Sub DrawHistogram(ByVal hType As Long, ByVal drawMethod As Long) 'Clear out whatever was there before picH.Cls 'tHeight is used to determine the height of the maximum value in the 'histogram. We want it to be slightly shorter than the height of the 'picture box; this way the tallest histogram value fills the entire picture Dim tHeight As Long tHeight = picH.ScaleHeight - 2 'LastX and LastY are used to draw a connecting line between histogram points Dim LastX As Long, LastY As Long 'The type of histogram we're drawing will determine the color of the histogram 'line - we'll make it match what we're drawing (red/green/blue/black) Select Case hType 'Red Case 0 picH.ForeColor = RGB(255, 0, 0) 'Green Case 1 picH.ForeColor = RGB(0, 255, 0) 'Blue Case 2 picH.ForeColor = RGB(0, 0, 255) 'Luminance Case 3 picH.ForeColor = RGB(0, 0, 0) End Select 'Now draw a little gradient below the histogram window (just 'cause Photoshop 'does it and it adds a nice touch, hehe ;) If hType < 3 Then 'Draw a gradient from black to the color of the current histogram model DrawGradient picGradient, RGB(0, 0, 0), picH.ForeColor Else 'For luminance, draw a gradient from black to white DrawGradient picGradient, RGB(0, 0, 0), RGB(255, 255, 255) End If 'Now we'll draw the histogram. Pay careful attention to this section of code 'For the first point there is no last 'x' or 'y', so we'll just make it the 'same as the first value in the histogram. (We care about this only if we're 'drawing a "connected lines" type of histogram.) LastX = 0 LastY = tHeight - (hData(hType, 0) / hMax(hType)) * tHeight 'Run a loop through every histogram value... For x = 0 To 255 'This is the most complicated line in the project. The y-value of the 'histogram is drawn as a percentage (RData(x) / MaxVal) * tHeight) with 'tHeight being the tallest possible value (when RData(x) = MaxVal). We 'then subtract that value from tHeight because y values INCREASE as we 'move DOWN a picture box - remember that (0,0) is in the top left. y = tHeight - (hData(hType, x) / hMax(hType)) * tHeight 'For connecting lines... If drawMethod = 0 Then 'Then draw a line from the last (x,y) to the current (x,y) picH.Line (LastX, LastY)-(x, y) LastX = x LastY = y 'For a bar graph... ElseIf drawMethod = 1 Then 'Draw a line from the bottom of the picture box to the calculated y-value picH.Line (x, tHeight)-(x, y) End If Next x 'Last but not least, generate the statistics at the bottom of the form 'Total number of pixels Dim fDraw As New FastDrawing Dim iWidth As Long, iHeight As Long iWidth = fDraw.GetImageWidth(frmMain.PicMain) iHeight = fDraw.GetImageHeight(frmMain.PicMain) lblTotalPixels.Caption = "Total pixels: " & (iWidth * iHeight) 'Maximum value lblMaxCount.Caption = hMax(hType) End Sub Private Sub Form_Terminate() Unload Me End Sub 'When the mouse moves over the histogram, display the level and count for the histogram 'entry at the x-value over which the mouse passes Private Sub picH_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single) lblLevel.Caption = x lblCount.Caption = hData(lastHistSource, x) End Sub Public Sub GenerateHistogram() 'This array will hold the image's pixel data Dim imageData() As Byte 'Image dimensions Dim iWidth As Long, iHeight As Long 'Instantiate a FastDrawing class and gather the image's data (into ImageData()) Dim fDraw As New FastDrawing iWidth = fDraw.GetImageWidth(frmMain.PicMain) iHeight = fDraw.GetImageHeight(frmMain.PicMain) fDraw.GetImageData2D frmMain.PicMain, imageData() 'These variables will hold temporary histogram values Dim r As Long, g As Long, b As Long, l As Long 'If the histogram has already been used, we need to clear out all the 'maximum values and histogram values For x = 0 To 3 hMax(x) = 0 For y = 0 To 255 hData(x, y) = 0 Next y Next x 'Run a quick loop through the image, gathering what we need to 'calculate our histogram Dim quickX As Long For x = 0 To iWidth - 1 quickX = x * 3 For y = 0 To iHeight - 1 'We have to gather the red, green, and blue in order to calculate luminance r = imageData(quickX + 2, y) g = imageData(quickX + 1, y) b = imageData(quickX, y) 'Rather than generate authentic luminance (which requires an HSL 'conversion routine), we'll use the shortcut formula - averaging 'R, G, and B. This is plenty accurate for a project like this. l = (r + g + b) \ 3 'Increment each value in the array, depending on its present value; 'this will let us see how many of each color value (and luminance 'value) there is in the image 'Red hData(0, r) = hData(0, r) + 1 'Green hData(1, g) = hData(1, g) + 1 'Blue hData(2, b) = hData(2, b) + 1 'Luminance hData(3, l) = hData(3, l) + 1 Next y Next x 'Run a quick loop through the completed array to find maximum values For x = 0 To 255 'Red If hData(0, x) > hMax(0) Then hMax(0) = hData(0, x) 'Green If hData(1, x) > hMax(1) Then hMax(1) = hData(1, x) 'Blue If hData(2, x) > hMax(2) Then hMax(2) = hData(2, x) 'Luminance If hData(3, x) > hMax(3) Then hMax(3) = hData(3, x) Next x 'When all has been completed, off we go to draw the histogram. Yay. 'We'll always draw the luminance histogram first; if the user has already looked 'at a particular histogram, remember which one and display it instead. DrawHistogram lastHistSource, lastHistMethod End Sub ======================= File: Artificial-life/frmMain.frm ======================= VERSION 5.00 Begin VB.Form frmMain Appearance = 0 'Flat BackColor = &H80000005& Caption = "Artificial Life Simulator - www.tannerhelland.com" ClientHeight = 8700 ClientLeft = 60 ClientTop = 450 ClientWidth = 12270 BeginProperty Font Name = "Arial" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty LinkTopic = "Form1" ScaleHeight = 580 ScaleMode = 3 'Pixel ScaleWidth = 818 StartUpPosition = 2 'CenterScreen Begin VB.PictureBox picFront Appearance = 0 'Flat BackColor = &H00FFFFFF& DrawWidth = 2 FillColor = &H00FF0000& FillStyle = 0 'Solid BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00FF0000& Height = 7530 Left = 120 MousePointer = 2 'Cross ScaleHeight = 500 ScaleMode = 3 'Pixel ScaleWidth = 500 TabIndex = 27 Top = 360 Width = 7530 End Begin VB.CommandButton cmdSaveData Caption = "Save simulation data to file..." BeginProperty Font Name = "Segoe UI" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = 4920 TabIndex = 26 Top = 8040 Width = 2775 End Begin VB.CheckBox chkDisplayDead Appearance = 0 'Flat BackColor = &H80000005& Caption = "Display dead creatures?" BeginProperty Font Name = "Segoe UI" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 255 Left = 120 TabIndex = 21 Top = 8160 Value = 1 'Checked Width = 2175 End Begin VB.Frame frmStartSettings Appearance = 0 'Flat BackColor = &H80000005& Caption = "Initial Simulation Settings:" BeginProperty Font Name = "Segoe UI" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 4095 Left = 7800 TabIndex = 7 Top = 1080 Width = 4215 Begin VB.TextBox txtMutations Appearance = 0 'Flat BeginProperty Font Name = "Segoe UI" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 285 Left = 2400 TabIndex = 24 Text = "15" Top = 3690 Width = 1695 End Begin VB.TextBox txtMutateTurns Appearance = 0 'Flat BeginProperty Font Name = "Segoe UI" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 285 Left = 2040 TabIndex = 22 Text = "750" Top = 3330 Width = 2055 End Begin VB.CheckBox chkMultiply Appearance = 0 'Flat BackColor = &H80000005& Caption = "Allow creatures to multiply and mutate" BeginProperty Font Name = "Segoe UI" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 255 Left = 120 TabIndex = 20 Top = 3000 Value = 1 'Checked Width = 3975 End Begin VB.TextBox txtFoodWorth Appearance = 0 'Flat BeginProperty Font Name = "Segoe UI" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 285 Left = 2640 TabIndex = 18 Text = "35" Top = 2490 Width = 1455 End Begin VB.TextBox txtFoodGen Appearance = 0 'Flat BeginProperty Font Name = "Segoe UI" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 285 Left = 2400 TabIndex = 16 Text = "5" Top = 2130 Width = 1695 End Begin VB.TextBox txtFoodRegen Appearance = 0 'Flat BeginProperty Font Name = "Segoe UI" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 285 Left = 2760 TabIndex = 14 Text = "20" Top = 1770 Width = 1335 End Begin VB.TextBox txtInitialEnergy Appearance = 0 'Flat BeginProperty Font Name = "Segoe UI" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 285 Left = 1440 TabIndex = 12 Text = "500" Top = 690 Width = 2655 End Begin VB.TextBox txtInitialFood Appearance = 0 'Flat BeginProperty Font Name = "Segoe UI" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 285 Left = 1800 TabIndex = 10 Text = "1500" Top = 1410 Width = 2295 End Begin VB.TextBox txtOrganisms Appearance = 0 'Flat BeginProperty Font Name = "Segoe UI" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 285 Left = 1440 TabIndex = 9 Text = "15" Top = 330 Width = 2655 End Begin VB.Label Label8 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "New DNA mutates (x) bases:" BeginProperty Font Name = "Segoe UI" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 120 TabIndex = 25 Top = 3720 Width = 2130 End Begin VB.Label Label7 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Multiply every (x) cycles:" BeginProperty Font Name = "Segoe UI" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 120 TabIndex = 23 Top = 3360 Width = 1800 End Begin VB.Line Line2 X1 = 120 X2 = 3360 Y1 = 2880 Y2 = 2880 End Begin VB.Label Label6 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Food grants this much energy: " BeginProperty Font Name = "Segoe UI" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 120 TabIndex = 19 Top = 2520 Width = 2400 End Begin VB.Label Label5 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Regenerate this much food: " BeginProperty Font Name = "Segoe UI" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 120 TabIndex = 17 Top = 2160 Width = 2190 End Begin VB.Label Label4 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Regenerate food every (n) cycles: " BeginProperty Font Name = "Segoe UI" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 120 TabIndex = 15 Top = 1800 Width = 2550 End Begin VB.Label Label3 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Initial energy: " BeginProperty Font Name = "Segoe UI" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 120 TabIndex = 13 Top = 720 Width = 1095 End Begin VB.Label Label2 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Initial food amount: " BeginProperty Font Name = "Segoe UI" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 120 TabIndex = 11 Top = 1440 Width = 1590 End Begin VB.Line Line1 X1 = 120 X2 = 4080 Y1 = 1200 Y2 = 1200 End Begin VB.Label Label1 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "# of creatures: " BeginProperty Font Name = "Segoe UI" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 120 TabIndex = 8 Top = 360 Width = 1155 End End Begin VB.Frame frmOrganisms Appearance = 0 'Flat BackColor = &H80000005& Caption = "Select a creature for detailed information:" BeginProperty Font Name = "Segoe UI" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 3135 Left = 7800 TabIndex = 4 Top = 5400 Width = 4215 Begin VB.TextBox txtInfo Appearance = 0 'Flat BeginProperty Font Name = "Segoe UI" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 2055 Left = 120 MultiLine = -1 'True TabIndex = 6 Top = 840 Width = 3975 End Begin VB.ComboBox cmbOrganisms BeginProperty Font Name = "Segoe UI" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 315 Left = 120 TabIndex = 5 Text = "Please start the simulator" Top = 360 Width = 3975 End End Begin VB.CommandButton cmdStop Caption = "STOP current simulation" BeginProperty Font Name = "Segoe UI" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = 9960 TabIndex = 3 Top = 240 Width = 2055 End Begin VB.CommandButton cmdStart Caption = "START new simulation" BeginProperty Font Name = "Segoe UI" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = 7800 TabIndex = 2 Top = 240 Width = 2055 End Begin VB.PictureBox picMap Appearance = 0 'Flat AutoRedraw = -1 'True BackColor = &H00FFFFFF& ClipControls = 0 'False DrawWidth = 2 FillColor = &H00E0E0E0& BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00FF0000& Height = 7530 Left = 120 MousePointer = 2 'Cross ScaleHeight = 500 ScaleMode = 3 'Pixel ScaleWidth = 500 TabIndex = 0 Top = 360 Visible = 0 'False Width = 7530 End Begin VB.PictureBox picFood Appearance = 0 'Flat AutoRedraw = -1 'True BackColor = &H00FFFFFF& ClipControls = 0 'False DrawWidth = 2 FillColor = &H00FF0000& BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00FF0000& Height = 7530 Left = 120 MousePointer = 2 'Cross ScaleHeight = 500 ScaleMode = 3 'Pixel ScaleWidth = 500 TabIndex = 28 Top = 360 Visible = 0 'False Width = 7530 End Begin VB.Label lblTitle Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "Press the start button to begin the simulator -------------------------------------------------->" BeginProperty Font Name = "Segoe UI" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 255 Left = 120 TabIndex = 1 Top = 120 Width = 7455 End End Attribute VB_Name = "frmMain" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False '*************************************************************************** 'Copyright 2018 by <NAME> ' www.tannerhelland.com ' 'Documentation for this project can be found at https://tannerhelland.com/code/ ' 'The source code in this project is licensed under a Simplified BSD license. ' For more information, please review LICENSE.md at https://github.com/tannerhelland/thdc-code/ ' 'If you find this code useful, please consider a small donation to https://www.paypal.me/TannerHelland ' 'Description: ' 'This program was the final project for one of my university bioinformatics courses. ' The basic premise is simple - generate an initial group of random critters, ' then allow them to move, eat, reproduce, and die. ' 'Many evolutionary principles are demonstrated by this little project, including ' genetic drift, population equilibrium, the "bottleneck" effect, and other aspects ' of small, closed populations. Many settings can be manually specified, which makes ' for a kind of "game" if you try to create a population that can last longer than ' several generations. (The default settings are actually quite close to achieving ' equilibrium, depending on the iteration.) ' '*************************************************************************** Option Explicit 'Array of artificial "organisms" Dim creatures() As Organism 'Whether or not the main program loop is actually running... Dim runSim As Boolean 'Variables used to show the user information about the simulation Dim totalCreatures As Long Dim numAlive As Long Dim numOfCycles As Long 'Option to display deceased creatures Private Sub chkDisplayDead_Click() drawDeadCreatures = chkDisplayDead picMap.Cls If (Not runSim) Then DrawMap End Sub 'Option to allow the creatures to reproduce (for mature audiences only) Private Sub chkMultiply_Click() toMultiply = chkMultiply End Sub 'The bottom-right combo box that displays information about a particular creature Private Sub cmbOrganisms_Click() 'Only update the box if a simulation is running (or has been run before) If (UBound(creatures) > 0) Then 'Mark all creatures as unselected For i = 0 To UBound(creatures) creatures(i).Selected = False 'Erase any currently selected creature If drawDeadCreatures Then creatures(i).DrawOrganism picMap Else If creatures(i).isAlive Then creatures(i).DrawOrganism picMap End If Next i '"Select" the current creature creatures(cmbOrganisms.ListIndex).Selected = True 'If this creature is dead, we have to go out of our way to draw it If drawDeadCreatures Then creatures(cmbOrganisms.ListIndex).DrawOrganism picMap 'Now we write a bunch of text to the creature text box With txtInfo .Text = "Creature #" & cmbOrganisms.ListIndex & vbCrLf .Text =.Text & "------------------------" & vbCrLf .Text =.Text & "Lifetime: " & creatures(cmbOrganisms.ListIndex).Lifetime & " cycles" If creatures(cmbOrganisms.ListIndex).isAlive Then .Text =.Text & " (still alive)" Else .Text =.Text & " (now dead)" End If .Text =.Text & vbCrLf .Text =.Text & "Size: " & creatures(cmbOrganisms.ListIndex).gSize & vbCrLf .Text =.Text & "Range: " & creatures(cmbOrganisms.ListIndex).gRange & vbCrLf .Text =.Text & "Speed: " & creatures(cmbOrganisms.ListIndex).gSpeed & vbCrLf .Text =.Text & "Current Energy: " & creatures(cmbOrganisms.ListIndex).Energy & vbCrLf .Text =.Text & "Parent: " 'The first generation of creatures are marked with -1 as their ParentID and AncestralID If (creatures(cmbOrganisms.ListIndex).ParentID = -1) Then .Text =.Text & "none (original)" & vbCrLf Else .Text =.Text & creatures(cmbOrganisms.ListIndex).ParentID & vbCrLf End If .Text =.Text & "Original ancestor: " If (creatures(cmbOrganisms.ListIndex).AncestralID = -1) Then .Text =.Text & "none (original)" & vbCrLf Else .Text =.Text & creatures(cmbOrganisms.ListIndex).AncestralID & vbCrLf End If End With End If End Sub 'Save dialog allows for export to a tab-delimited text file. This allows for surprisingly ' powerful analyses using any modern spreadsheet or statistical software. Private Sub cmdSaveData_Click() 'New CommonDialog object (prevents us from having to bundle the OCX) Dim cDialog As pdOpenSaveDialog Set cDialog = New pdOpenSaveDialog 'Use the dialog to get a save file location from the user Dim sFile As String If cDialog.GetSaveFileName(sFile,, True, "Simulation data (.txt)|*.txt|All files|*.*",,, "Save simulation data", ".txt", frmMain.hWnd) Then If FileExist(sFile) Then Kill sFile Open sFile For Output As #1 'Create a header row Dim hInfo As String hInfo = "Creature#" & vbTab & "Lifetime" & vbTab & "Size" & vbTab & "Range" & vbTab & "Speed" & vbTab & "Parent" & vbTab & "AncestralID" & vbTab & "DNA" Print #1, hInfo 'Don't write anything further unless a simulation has been ran If (UBound(creatures) > 0) Then 'Loop through every creature, dumping info into the file as we go For i = 0 To UBound(creatures) 'A temporary string for storing the information on this creature Dim tInfo As String tInfo = creatures(i).ID & vbTab tInfo = tInfo & creatures(i).Lifetime & vbTab tInfo = tInfo & creatures(i).gSize & vbTab tInfo = tInfo & creatures(i).gRange & vbTab tInfo = tInfo & creatures(i).gSpeed & vbTab If (creatures(i).ParentID = -1) Then tInfo = tInfo & "n/a" & vbTab Else tInfo = tInfo & creatures(i).ParentID & vbTab End If If (creatures(i).AncestralID = -1) Then tInfo = tInfo & "n/a" & vbTab Else tInfo = tInfo & creatures(i).AncestralID & vbTab End If 'As a bonus, include the creature's actual "DNA" strand For x = 0 To creatures(i).GetMaxDNA tInfo = tInfo & creatures(i).GetDNABase(x) Next x 'Write the line to file Print #1, tInfo Next i End If Close #1 End If End Sub 'START button: begin a new simulation Private Sub cmdStart_Click() 'Clear out the buffer picture boxes picMap.Picture = LoadPicture(vbNullString) picFood.Picture = LoadPicture(vbNullString) 'Collect important values from text boxes and check boxes startEnergy = CLng(txtInitialEnergy) InitialCreatures = CLng(txtOrganisms) - 1 foodRegen = CLng(txtFoodRegen) foodGen = CLng(txtFoodGen) foodWorth = CLng(txtFoodWorth) toMultiply = chkMultiply drawDeadCreatures = chkDisplayDead mutateTurns = CLng(txtMutateTurns) numOfMutations = CLng(txtMutations) 'Randomly fill the food array with the specified amount of food ReDim Food(0 To WORLDWIDTH, 0 To WORLDHEIGHT) As Long For i = 0 To CLng(txtInitialFood) x = Int(Rnd * WORLDWIDTH) y = Int(Rnd * WORLDHEIGHT) Food(x, y) = 255 Next i 'Draw the food to its own special picture box For x = 0 To WORLDWIDTH For y = 0 To WORLDHEIGHT If (Food(x, y) > 0) Then SetPixelV picFood.hDC, x, y, RGB(0, 64, 0) Next y Next x 'Empty the "select a creature" combo box cmbOrganisms.Clear 'Create the original batch of creatures ReDim creatures(0 To InitialCreatures) As Organism For i = 0 To InitialCreatures Set creatures(i) = New Organism creatures(i).CreateRandom creatures(i).ID = i creatures(i).oX = Int(Rnd * WORLDWIDTH) creatures(i).osX = creatures(i).oX creatures(i).oY = Int(Rnd * WORLDHEIGHT) creatures(i).osY = creatures(i).oY cmbOrganisms.AddItem "Creature #" & i Next i 'Reset other tracking data numOfCycles = 0 numAlive = InitialCreatures totalCreatures = InitialCreatures 'Start the simulation runSim = True MainLoop End Sub 'STOP button: only stops the simulation; it does NOT erase any data ' (in case the user wants to export to a file for further analyses) Private Sub cmdStop_Click() runSim = False End Sub 'When the program is first started... Private Sub Form_Load() 'Set the main loop as "not running" runSim = False 'Seed the random number generator Randomize Timer 'Prepare the creature array ReDim creatures(0) As Organism 'Display some explanatory text txtInfo.Text = "Please select a creature from the drop-down box." End Sub 'DRAW EVERYTHING: copy the food buffer to a new buffer, add the creatures, then flip the ' composited buffer to the screen Private Sub DrawMap() 'Copy the food buffer to the creature buffer BitBlt picMap.hDC, 0, 0, picMap.ScaleWidth, picMap.ScaleHeight, picFood.hDC, 0, 0, vbSrcCopy 'Next, draw all the creatures over the food For i = 0 To UBound(creatures) If drawDeadCreatures Then creatures(i).DrawOrganism picMap Else If creatures(i).isAlive Then creatures(i).DrawOrganism picMap End If Next i 'Last, copy the composited image to the screen (doing it this way prevents flickering) BitBlt picFront.hDC, 0, 0, picFront.ScaleWidth, picFront.ScaleHeight, picMap.hDC, 0, 0, vbSrcCopy End Sub 'Food is randomly regenerated at a rate specified by the user Private Sub GenerateFood() Dim setNewFood As Long 'Assign setNewFood an arbitrary value between zero and a million setNewFood = Int(Rnd * 1000000) 'This formula makes it so that roughly every foodRegen turns, new food is drawn If (setNewFood Mod foodRegen = 0) Then 'Draw new food (the amount specified by the user) at random locations For i = 0 To foodGen x = Int(Rnd * WORLDWIDTH) y = Int(Rnd * WORLDHEIGHT) 'Mark this spot in the food array as being "filled" Food(x, y) = 255 'Draw food as a pleasant dark green color SetPixelV picFood.hDC, x, y, RGB(0, 64, 0) Next i End If End Sub 'THE MAIN PROGRAM LOOP. It runs when start is pushed and stops when stop is pushed. Advanced, I know. Private Sub MainLoop() 'Count keeps track of how many times the loop has been run Dim count As Long count = 1 'If "stop" has not been pressed, process another iteration of the loop Do While runSim = True 'First, attempt to generate food GenerateFood 'The "think" routine allows all the creatures one turn worth of brain activity Think 'If the creatures have been allowed to multiply, do that now If toMultiply = True Then 'Only reproduce once every <mutateTurns> If count Mod mutateTurns = 0 Then 'Cycle through each creature one-at-a-time For i = 0 To UBound(creatures) 'If this creature is a) alive and b) has existed for at least one lifecycle '(i.e. it wasn't just created), let it reproduce If (creatures(i).isAlive = True And creatures(i).Lifetime >= mutateTurns) Then 'Track some basic statistics totalCreatures = totalCreatures + 1 numAlive = numAlive + 1 'Make room in the array for a new creature ReDim Preserve creatures(0 To totalCreatures) As Organism 'Create the creature using its parent's data Set creatures(totalCreatures) = New Organism creatures(totalCreatures).CreateFromCreature creatures(i) creatures(totalCreatures).ID = totalCreatures creatures(totalCreatures).oX = creatures(i).oX creatures(totalCreatures).osX = creatures(i).osX creatures(totalCreatures).oY = creatures(i).oY creatures(totalCreatures).osY = creatures(i).osY 'Add this creature's entry to the combo box cmbOrganisms.AddItem "Creature #" & totalCreatures End If Next i End If End If 'Update the statistics label lblTitle.Caption = "Running simulator: " & numAlive & " alive, " & (totalCreatures - numAlive + 1) & " dead @ " & count & " cycles" 'Draw everything DrawMap 'Pause for user events DoEvents 'If all our creatures have died, end the loop automatically If numAlive = 0 Then runSim = False count = count + 1 Loop End Sub 'THINK: the routine that allows each creature one round of brain activity Private Sub Think() 'Reset the number of living creatures numAlive = 0 'Loop through every creature, allowing each a moment of simple thought processing For i = 0 To UBound(creatures) If creatures(i).isAlive = True Then creatures(i).Brain 'Track the number of living creatures while we're at it numAlive = numAlive + 1 End If Next i End Sub 'If the user shuts down the program, make sure our creatures don't remain alive in the background Private Sub Form_Unload(Cancel As Integer) runSim = False End Sub 'If the user clicks on a particular creature, display that creature's information Private Sub picFront_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) 'Allow left mouseclicks to select a creature... If Button = 1 Then Dim minDistance As Single Dim curDist As Single Dim minIndex As Long minDistance = 10000 minIndex = 0 'Ignore mouse clicks if a simulation hasn't been run If UBound(creatures) > 0 Then 'Loop through each creature and find the one whose center is closest to the 'click location For i = 0 To UBound(creatures) 'If dead creatures aren't being drawn, and this creature is dead, ignore it If drawDeadCreatures = False And creatures(i).isAlive = False Then GoTo NEXTI 'Calculate distance curDist = Distance(x, y, creatures(i).oX, creatures(i).oY) 'If this one is closer than what we currently have, promote it If curDist < minDistance Then minDistance = curDist minIndex = i End If NEXTI: Next i 'Only allow a creature to be selected if the click was physically inside the 'creature's radius If minDistance < (creatures(minIndex).gRange * 2) Then If drawDeadCreatures = True Then cmbOrganisms.ListIndex = minIndex Else If creatures(minIndex).isAlive = True Then cmbOrganisms.ListIndex = minIndex End If End If '...otherwise, ignore this click Else For i = 0 To UBound(creatures) creatures(i).Selected = False Next i cmbOrganisms.Text = "Please select a creature" txtInfo.Text = "Please select a creature from the drop-down box. Once selected, it will turn BLACK for easy identification." End If End If '...while right and middle-clicks remove any previous selections Else If UBound(creatures) > 0 Then For i = 0 To UBound(creatures) creatures(i).Selected = False Next i End If cmbOrganisms.Text = "Please select a creature" txtInfo.Text = "Please select a creature from the drop-down box. Once selected, it will turn BLACK for easy identification." End If End Sub 'Simple Euclidean distance function Private Function Distance(ByVal x1 As Single, ByVal y1 As Single, ByVal x2 As Single, ByVal y2 As Single) Distance = Sqr((x1 - x2) ^ 2 + (y1 - y2) ^ 2) End Function 'Check to see if a file with this name already exists Private Function FileExist(fName As String) As Boolean On Error Resume Next Dim Temp As Long Temp = GetAttr(fName) FileExist = Not CBool(Err) End Function ======================= File: Map-editor-2D/Main Editor.frm ======================= VERSION 5.00 Begin VB.Form Main BackColor = &H00FFFFFF& Caption = "Basic Tile Map Editor - www.tannerhelland.com" ClientHeight = 8775 ClientLeft = 165 ClientTop = 450 ClientWidth = 12735 LinkTopic = "Form1" ScaleHeight = 585 ScaleMode = 3 'Pixel ScaleWidth = 849 StartUpPosition = 2 'CenterScreen Begin VB.ComboBox cmbDrawMethod Appearance = 0 'Flat BeginProperty Font Name = "Arial" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 330 Left = 0 Style = 2 'Dropdown List TabIndex = 8 Top = 3720 Width = 1455 End Begin VB.HScrollBar HSMain Height = 255 Left = 120 TabIndex = 6 Top = 8400 Width = 12135 End Begin VB.VScrollBar VSMain Height = 6735 Left = 12360 TabIndex = 5 Top = 1560 Width = 255 End Begin VB.HScrollBar HSTileBar Height = 255 Left = 120 Max = 5 TabIndex = 4 Top = 1200 Width = 12495 End Begin VB.PictureBox PicTiles Appearance = 0 'Flat AutoRedraw = -1 'True BackColor = &H00E0E0E0& ForeColor = &H80000008& Height = 990 Left = 120 ScaleHeight = 64 ScaleMode = 3 'Pixel ScaleWidth = 834 TabIndex = 0 Top = 120 Width = 12540 End Begin VB.PictureBox PicTilesBuffer Appearance = 0 'Flat AutoRedraw = -1 'True AutoSize = -1 'True BackColor = &H80000005& ForeColor = &H80000008& Height = 990 Left = 0 Picture = "Main Editor.frx":0000 ScaleHeight = 64 ScaleMode = 3 'Pixel ScaleWidth = 1024 TabIndex = 3 Top = 0 Visible = 0 'False Width = 15390 End Begin VB.PictureBox Pic1 Appearance = 0 'Flat AutoRedraw = -1 'True BackColor = &H80000005& ForeColor = &H80000008& Height = 990 Left = 0 ScaleHeight = 64 ScaleMode = 3 'Pixel ScaleWidth = 64 TabIndex = 1 Top = 4560 Width = 990 End Begin VB.PictureBox MainPic Appearance = 0 'Flat AutoRedraw = -1 'True BackColor = &H00404040& ForeColor = &H80000008& Height = 6735 Left = 120 ScaleHeight = 447 ScaleMode = 3 'Pixel ScaleWidth = 807 TabIndex = 2 Top = 1560 Width = 12135 Begin VB.PictureBox Pic2 Appearance = 0 'Flat AutoRedraw = -1 'True BackColor = &H80000005& ForeColor = &H80000008& Height = 990 Left = 360 ScaleHeight = 64 ScaleMode = 3 'Pixel ScaleWidth = 64 TabIndex = 7 Top = 3360 Width = 990 End End Begin VB.Menu MnuFile Caption = "&File" Begin VB.Menu MnuNew Caption = "&New Map" Shortcut = ^N End Begin VB.Menu MnuOpen Caption = "&Open Map" Shortcut = ^O End Begin VB.Menu MnuSave Caption = "&Save Current Map" Shortcut = ^S End Begin VB.Menu MnuSepBar1 Caption = "-" End Begin VB.Menu MnuExit Caption = "E&xit" Shortcut = ^X End End Begin VB.Menu MnuOptions Caption = "&Options" Begin VB.Menu MnuResize Caption = "Resize the Map" End End Begin VB.Menu MnuView Caption = "&View" Begin VB.Menu MnuRefresh Caption = "&Refresh Screen" Shortcut = ^R End Begin VB.Menu MnuSepBar2 Caption = "-" End Begin VB.Menu mnuZoom Caption = "Change &Zoom" Shortcut = ^Z End End End Attribute VB_Name = "Main" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False '*************************************************************************** 'Copyright 2018 by <NAME> ' www.tannerhelland.com ' 'Documentation for this project can be found at https://tannerhelland.com/code/ ' 'The source code in this project is licensed under a Simplified BSD license. ' For more information, please review LICENSE.md at https://github.com/tannerhelland/thdc-code/ ' 'If you find this code useful, please consider a small donation to https://www.paypal.me/TannerHelland ' '*************************************************************************** 'When the combo box is changed, update our drawing method Private Sub cmbDrawMethod_Change() Select Case cmbDrawMethod.ListIndex Case 0 UseStretchBlt = False Case 1 UseStretchBlt = True End Select End Sub Private Sub cmbDrawMethod_Click() Select Case cmbDrawMethod.ListIndex Case 0 UseStretchBlt = False Case 1 UseStretchBlt = True End Select End Sub 'The InitializeEditor routine can be found in Sub_Module Private Sub Form_Load() InitializeEditor 'Also, populate the DrawMethod combo box cmbDrawMethod.AddItem "Use PaintPicture" cmbDrawMethod.AddItem "Use StretchBlt" cmbDrawMethod.ListIndex = 0 UseStretchBlt = False 'Load a default map On Error GoTo MapMissing Open App.Path & "\Demo.map" For Binary As #1 'At present, map files are pretty simple - the width, height, and data is all we currently store Get #1, 1, SizeX Get #1,, SizeY ReDim MapArray(0 To SizeX, 0 To SizeY) As Byte Get #1,, MapArray Close #1 'Once MapArray has been successfully created, Draw the map! DrawMap MapMissing: End Sub 'Whenever a scrollbar is used, update the map Private Sub HSMain_Change() ScrollMap End Sub Private Sub HSMain_Scroll() ScrollMap End Sub Private Sub VSMain_Change() ScrollMap End Sub Private Sub VSMain_Scroll() ScrollMap End Sub Private Sub HSTileBar_Change() DrawTileBar End Sub 'Whenever the top scrollbar is used, update the tiles Private Sub HSTileBar_Scroll() DrawTileBar End Sub 'When a mouse button is pressed, remember the mouse state (1 = pressed) and draw a tile at the current mouse position Private Sub MainPic_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single) MouseState = True 'Left button If Button = 1 Then DrawTile x, Y, CurPicIndex 'Right button If Button = 2 Then DrawTile x, Y, CurPicIndex2 End Sub 'When the mouse is moved, only draw if a mouse button has been pressed Private Sub MainPic_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single) 'Only draw if a button is down If MouseState Then If Button = 1 Then DrawTile x, Y, CurPicIndex If Button = 2 Then DrawTile x, Y, CurPicIndex2 End If End Sub 'Return the mouse button state variable to unpressed Private Sub MainPic_MouseUp(Button As Integer, Shift As Integer, x As Single, Y As Single) MouseState = False End Sub 'Menu -> Exit Private Sub MnuExit_Click() Unload Me End Sub 'Menu -> New Private Sub MnuNew_Click() 'Keep the current size settings and reset the map to zero (default tile) For x = 0 To SizeX For Y = 0 To SizeY MapArray(x, Y) = 0 Next Y Next x 'Last, draw the new map DrawMap End Sub 'Menu -> Open Private Sub MnuOpen_Click() 'Initialize the common dialog interface Dim newDialog As pdOpenSaveDialog Set newDialog = New pdOpenSaveDialog 'String returned from the common dialog wrapper Dim sFile As String 'This string contains the filters for loading different kinds of images. Using 'this feature correctly makes our common dialog box a LOT more pleasant to use. Dim cdfStr As String cdfStr = "VB Map Files (.map)|*.map|All Files|*.*" 'If cancel isn't selected, load a map from the user-specified file If newDialog.GetOpenFileName(sFile,, True,, cdfStr, 1,, "Open a map file",, Me.hWnd) Then 'Open the file Open sFile For Binary As #1 'At present, map files are pretty simple - the width, height, and data is all we currently store Get #1, 1, SizeX Get #1,, SizeY ReDim MapArray(0 To SizeX, 0 To SizeY) As Byte Get #1,, MapArray Close #1 'Once MapArray has been successfully created, Draw the map! DrawMap End If End Sub 'Menu -> Refresh Private Sub MnuRefresh_Click() RefreshAll End Sub 'Menu -> Resize Private Sub MnuResize_Click() FrmResize.Visible = True End Sub 'Menu -> Save Private Sub MnuSave_Click() 'Initialize the common dialog interface Dim newDialog As pdOpenSaveDialog Set newDialog = New pdOpenSaveDialog 'String returned from the common dialog wrapper Dim sFile As String 'This string contains the filters for loading different kinds of images. Using 'this feature correctly makes our common dialog box a LOT more pleasant to use. Dim cdfStr As String cdfStr = "VB Map Files (.map)|*.map|All Files|*.*" 'If cancel isn't selected, save a map to the user-specified file If newDialog.GetSaveFileName(sFile,,, cdfStr, 1,, "Save a map file", ".map", Me.hWnd) Then 'Open the file Open sFile For Binary As #1 'At present, map files are pretty simple - the width, height, and data is all we currently store Put #1, 1, SizeX Put #1,, SizeY Put #1,, MapArray Close #1 End If End Sub 'Menu -> Zoom Private Sub mnuZoom_Click() ChangeZoom End Sub 'When the top tile box is clicked, remember which tile was clicked (and draw that tile in its preview box) Private Sub PicTiles_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single) 'Left button... If Button = 1 Then 'Current picture is the x value integer divided by 64 (tile width) + whatever the scrollbar is at CurPicIndex = (x \ 64) + HSTileBar.Value 'Draw this tile in its picture box on the left If UseStretchBlt Then StretchBlt Pic1.hdc, 0, 0, 64, 64, PicTilesBuffer.hdc, CurPicIndex * 64, 0, 64, 64, vbSrcCopy Else Pic1.PaintPicture PicTilesBuffer.Picture, 0, 0, 64, 64, CurPicIndex * 64, 0, 64, 64, vbSrcCopy End If 'Right button... ElseIf Button = 2 Then CurPicIndex2 = (x \ 64) + HSTileBar.Value If UseStretchBlt Then StretchBlt Pic2.hdc, 0, 0, 64, 64, PicTilesBuffer.hdc, CurPicIndex2 * 64, 0, 64, 64, vbSrcCopy Else Pic2.PaintPicture PicTilesBuffer.Picture, 0, 0, 64, 64, CurPicIndex2 * 64, 0, 64, 64, vbSrcCopy End If End If 'Because AutoRedraw is set to true for these pictures boxes, we must refresh them and update the.Picture property Pic1.Picture = Pic1.Image Pic2.Picture = Pic2.Image Pic1.Refresh Pic2.Refresh End Sub ======================= File: Artificial-life/Declarations.bas ======================= <gh_stars>10-100 Attribute VB_Name = "Declarations" 'API calls 'Standard image blitting; faster than VB's internal PaintPicture method Public Declare Function BitBlt Lib "gdi32" (ByVal hDstDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long 'Standard pixel setting; much faster than VB's internal PSet and Point methods Public Declare Function GetPixel Lib "gdi32" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long) As Long Public Declare Function SetPixelV Lib "gdi32" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Byte 'Size of the map; these dimensions can theoretically be changed, but you'll need ' to manually resize the various picture boxes to match Public Const WORLDWIDTH As Long = 499 Public Const WORLDHEIGHT As Long = 499 'Amount of food to generate every round Public foodGen As Long 'How much energy the food grants Public foodWorth As Long 'Default starting energy for each creature Public startEnergy As Long 'Regenerate food every (foodRegen) number of turns Public foodRegen As Long 'Mutation values 'Whether or not to allow reproduction (a.k.a. the "celibacy" variable) Public toMultiply As Boolean 'How many turns must pass before creatures are allowed to reproduce Public mutateTurns As Long 'How many potential mutations to cause at reproduction time Public numOfMutations As Long 'Amount of creatures to start with Public InitialCreatures As Long 'The food array Public Food() As Long 'Whether or not to draw deceased creatures Public drawDeadCreatures As Boolean 'Loop variables Public i As Long, j As Long Public x As Long, y As Long ======================= File: Hidden-Markov-model/frmHMM.frm ======================= <filename>Hidden-Markov-model/frmHMM.frm VERSION 5.00 Begin VB.Form frmMain BackColor = &H00C0C0C0& Caption = "Hidden Markov Models and CpG Islands in VB6 - www.tannerhelland.com" ClientHeight = 8790 ClientLeft = 60 ClientTop = 450 ClientWidth = 13830 BeginProperty Font Name = "Tahoma" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty LinkTopic = "Form1" ScaleHeight = 586 ScaleMode = 3 'Pixel ScaleWidth = 922 StartUpPosition = 2 'CenterScreen Begin VB.Frame frm4 Appearance = 0 'Flat BackColor = &H00C0C0C0& Caption = "Step 4: Run a sliding window analysis to determine possible CG island locations" ForeColor = &H80000008& Height = 3375 Left = 120 TabIndex = 39 Top = 4920 Width = 13575 Begin VB.PictureBox picOE Appearance = 0 'Flat AutoRedraw = -1 'True BackColor = &H80000005& ForeColor = &H80000008& Height = 975 Left = 120 ScaleHeight = 63 ScaleMode = 3 'Pixel ScaleWidth = 887 TabIndex = 45 Top = 1080 Width = 13335 End Begin VB.PictureBox picResults Appearance = 0 'Flat AutoRedraw = -1 'True BackColor = &H80000005& ForeColor = &H80000008& Height = 975 Left = 120 ScaleHeight = 63 ScaleMode = 3 'Pixel ScaleWidth = 887 TabIndex = 44 Top = 2280 Width = 13335 End Begin VB.TextBox txtWindowSize Appearance = 0 'Flat Height = 285 Left = 5040 TabIndex = 42 Text = "200" Top = 480 Width = 855 End Begin VB.CommandButton cmdWindow Caption = "Scan with sliding window" Enabled = 0 'False Height = 375 Left = 240 TabIndex = 40 Top = 360 Width = 3015 End Begin VB.Label lblRecommendation BackStyle = 0 'Transparent Caption = " After running your analyses, any estimated CG islands will appear here." Height = 375 Left = 6360 TabIndex = 49 Top = 480 Width = 6975 End Begin VB.Label lblPercent BackStyle = 0 'Transparent Caption = " I/B Ratio:" Height = 255 Left = 120 TabIndex = 47 Top = 2040 Width = 13335 End Begin VB.Label lblCGHeader BackStyle = 0 'Transparent Caption = " C/G Observed vs. Expected:" Height = 255 Left = 120 TabIndex = 46 Top = 840 Width = 13335 End Begin VB.Label Label15 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Sliding window size:" Height = 195 Left = 3480 TabIndex = 41 Top = 480 Width = 1410 End End Begin VB.Frame frm3 Appearance = 0 'Flat BackColor = &H00C0C0C0& Caption = "Step 3: Run the HMM and Viterbi algorithm on your data " ForeColor = &H80000008& Height = 975 Left = 120 TabIndex = 37 Top = 3840 Width = 7455 Begin VB.CommandButton cmdHMM Caption = "Run the algorithm!" Enabled = 0 'False Height = 375 Left = 240 TabIndex = 38 Top = 360 Width = 3015 End Begin VB.Label lblStep3Results Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "Results: *none processed*" ForeColor = &H80000008& Height = 375 Left = 3480 TabIndex = 43 Top = 360 Width = 3855 End End Begin VB.Frame frm2 Appearance = 0 'Flat BackColor = &H00C0C0C0& Caption = "Step 2: Input HMM Parameters " ForeColor = &H80000008& Height = 2535 Left = 120 TabIndex = 5 Top = 1200 Width = 7455 Begin VB.CommandButton cmdEstimate Caption = "Estimate state probabilities" Height = 495 Left = 5160 TabIndex = 48 Top = 1800 Width = 2055 End Begin VB.Frame frmInitial Appearance = 0 'Flat BackColor = &H00C0C0C0& Caption = "Initial Probabilities:" ForeColor = &H80000008& Height = 1215 Left = 5160 TabIndex = 32 Top = 360 Width = 1695 Begin VB.TextBox txtInitProb Appearance = 0 'Flat Height = 285 Index = 1 Left = 600 TabIndex = 36 Text = ".5" Top = 720 Width = 615 End Begin VB.TextBox txtInitProb Appearance = 0 'Flat Height = 285 Index = 0 Left = 600 TabIndex = 35 Text = ".5" Top = 360 Width = 615 End Begin VB.Label Label14 Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "p(I):" ForeColor = &H80000008& Height = 255 Left = 120 TabIndex = 34 Top = 720 Width = 375 End Begin VB.Label Label13 Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "p(B):" ForeColor = &H80000008& Height = 255 Left = 120 TabIndex = 33 Top = 360 Width = 375 End End Begin VB.Frame frmState Appearance = 0 'Flat BackColor = &H00C0C0C0& Caption = "State Probabilities:" ForeColor = &H80000008& Height = 1935 Left = 2040 TabIndex = 15 Top = 360 Width = 2895 Begin VB.TextBox txtStateProb Appearance = 0 'Flat Height = 285 Index = 7 Left = 2040 TabIndex = 31 Text = ".25" Top = 1440 Width = 615 End Begin VB.TextBox txtStateProb Appearance = 0 'Flat Height = 285 Index = 6 Left = 2040 TabIndex = 29 Text = ".25" Top = 1080 Width = 615 End Begin VB.TextBox txtStateProb Appearance = 0 'Flat Height = 285 Index = 5 Left = 2040 TabIndex = 27 Text = ".25" Top = 720 Width = 615 End Begin VB.TextBox txtStateProb Appearance = 0 'Flat Height = 285 Index = 4 Left = 2040 TabIndex = 25 Text = ".25" Top = 360 Width = 615 End Begin VB.TextBox txtStateProb Appearance = 0 'Flat Height = 285 Index = 3 Left = 720 TabIndex = 23 Text = ".4" Top = 1440 Width = 615 End Begin VB.TextBox txtStateProb Appearance = 0 'Flat Height = 285 Index = 2 Left = 720 TabIndex = 21 Text = ".25" Top = 1080 Width = 615 End Begin VB.TextBox txtStateProb Appearance = 0 'Flat Height = 285 Index = 1 Left = 720 TabIndex = 19 Text = ".1" Top = 720 Width = 615 End Begin VB.TextBox txtStateProb Appearance = 0 'Flat Height = 285 Index = 0 Left = 720 TabIndex = 17 Text = ".25" Top = 360 Width = 615 End Begin VB.Label Label12 Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "p(t|I):" ForeColor = &H80000008& Height = 255 Left = 1440 TabIndex = 30 Top = 1440 Width = 735 End Begin VB.Label Label11 Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "p(g|I):" ForeColor = &H80000008& Height = 255 Left = 1440 TabIndex = 28 Top = 1080 Width = 735 End Begin VB.Label Label10 Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "p(c|I):" ForeColor = &H80000008& Height = 255 Left = 1440 TabIndex = 26 Top = 720 Width = 735 End Begin VB.Label Label9 Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "p(a|I):" ForeColor = &H80000008& Height = 255 Left = 1440 TabIndex = 24 Top = 360 Width = 735 End Begin VB.Label Label8 Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "p(t|B):" ForeColor = &H80000008& Height = 255 Left = 120 TabIndex = 22 Top = 1440 Width = 735 End Begin VB.Label Label7 Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "p(g|B):" ForeColor = &H80000008& Height = 255 Left = 120 TabIndex = 20 Top = 1080 Width = 735 End Begin VB.Label Label6 Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "p(c|B):" ForeColor = &H80000008& Height = 255 Left = 120 TabIndex = 18 Top = 720 Width = 735 End Begin VB.Label Label5 Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "p(a|B):" ForeColor = &H80000008& Height = 255 Left = 120 TabIndex = 16 Top = 360 Width = 735 End End Begin VB.Frame frmIslandOrNot Appearance = 0 'Flat BackColor = &H00C0C0C0& Caption = "I/B Probabilities" ForeColor = &H80000008& Height = 1935 Left = 120 TabIndex = 6 Top = 360 Width = 1695 Begin VB.TextBox txtIBprob Appearance = 0 'Flat Height = 285 Index = 3 Left = 840 TabIndex = 14 Text = ".5" Top = 1440 Width = 615 End Begin VB.TextBox txtIBprob Appearance = 0 'Flat Height = 285 Index = 2 Left = 840 TabIndex = 12 Text = ".5" Top = 1080 Width = 615 End Begin VB.TextBox txtIBprob Appearance = 0 'Flat Height = 285 Index = 1 Left = 840 TabIndex = 10 Text = ".3" Top = 720 Width = 615 End Begin VB.TextBox txtIBprob Appearance = 0 'Flat Height = 285 Index = 0 Left = 840 TabIndex = 8 Text = ".7" Top = 360 Width = 615 End Begin VB.Label Label4 Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "p(I->I):" ForeColor = &H80000008& Height = 255 Left = 120 TabIndex = 13 Top = 1440 Width = 735 End Begin VB.Label Label3 Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "p(I->B):" ForeColor = &H80000008& Height = 255 Left = 120 TabIndex = 11 Top = 1080 Width = 735 End Begin VB.Label Label2 Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "p(B->I):" ForeColor = &H80000008& Height = 255 Left = 120 TabIndex = 9 Top = 720 Width = 735 End Begin VB.Label Label1 Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "p(B->B):" ForeColor = &H80000008& Height = 255 Left = 120 TabIndex = 7 Top = 360 Width = 735 End End End Begin VB.TextBox txtTest Appearance = 0 'Flat Height = 4575 Left = 7680 MultiLine = -1 'True ScrollBars = 3 'Both TabIndex = 3 Text = "frmHMM.frx":0000 Top = 240 Width = 6015 End Begin VB.Frame frm1 Appearance = 0 'Flat BackColor = &H00C0C0C0& Caption = "Step 1: Load information from a FASTA file " ForeColor = &H80000008& Height = 975 Left = 120 TabIndex = 0 Top = 120 Width = 7455 Begin VB.CommandButton cmdOpenFASTA Caption = "Open a FASTA file..." Height = 375 Left = 120 TabIndex = 1 Top = 360 Width = 3015 End Begin VB.Label lblFile Appearance = 0 'Flat BackColor = &H00C0C0C0& Caption = "Current file: *none selected*" ForeColor = &H80000008& Height = 375 Left = 3360 TabIndex = 2 Top = 360 Width = 3975 End End Begin VB.Label lblMessage Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent BorderStyle = 1 'Fixed Single Caption = " Useful messages related to program operations will appear in this box." ForeColor = &H000000C0& Height = 255 Left = 120 TabIndex = 4 Top = 8400 Width = 13575 End End Attribute VB_Name = "frmMain" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False '*************************************************************************** 'HMM, Viterbi, and Sliding Window Algorithms (for purposes of locating genes in human DNA) 'Copyright 2018 by <NAME> ' www.tannerhelland.com ' 'This project demonstrates use of a Hidden Markov Model (HMM) to define the relationship ' between normal states (B) and island states (I) within a region of the human chromosome. ' This algorithm proves particularly useful for gene finding, as CpG islands (regions of DNA ' with a larger than expected number of adjacent cytosine and guanine nucleotides) tend to ' appear near the promoters of some 40% of mammalian genes. The automation of this process ' is critical in gene research because CpG islands are impossible to locate by simply looking ' at a strand of DNA (as they may cover several hundred bases and their C/G content may be ' only slightly higher than the expected value). ' 'The algorithm is fast, robust, and it includes a wealth of good routines (such as loading FASTA ' files into VB). I've tried to include comments where applicable. ' 'The source code in this project is licensed under a Simplified BSD license. ' For more information, please review LICENSE.md at https://github.com/tannerhelland/thdc-code/ ' 'If you find this code useful, please consider a small donation to https://www.paypal.me/TannerHelland ' '*************************************************************************** Option Explicit 'Stores all lines from the FASTA file Dim fText() As String 'Maximum number of lines in the FASTA file Dim eFile As Long 'Byte array of all our DNA data 'a = 0, c = 1, g = 2, t = 3 Dim DNA() As Byte 'Length of the DNA strand Dim lenDNA As Long 'Total amounts of A, C, G, and T nucleotides Dim aTot As Long, cTot As Long, gTot As Long, tTot As Long 'These look-up tables will hold data for various probabilities Dim pIorB(0 To 3) As Double Dim pState(0 To 7) As Double Dim pInitial(0 To 1) As Double 'The results of the Viterbi algorithm (0 = B, 1 = I) Dim vHMM() As Double 'Multi-use variables Dim x As Long, y As Long 'Estimate state probabilities based on total amounts of A, C, G, and T Private Sub cmdEstimate_Click() Dim total As Long total = aTot + cTot + gTot + tTot txtStateProb(0).Text = aTot / total txtStateProb(1).Text = cTot / total txtStateProb(2).Text = gTot / total txtStateProb(3).Text = tTot / total txtStateProb(4).Text = txtStateProb(0) / 2 txtStateProb(5).Text = txtStateProb(1) * 2 txtStateProb(6).Text = txtStateProb(2) * 2 txtStateProb(7).Text = txtStateProb(3) / 2 End Sub 'This routine performs the actual HMM and Viterbi algorithms Private Sub cmdHMM_Click() Message "Building look-up tables..." 'First, collect all of probabilities into look-up tables For x = 0 To 3 pIorB(x) = Log(CDbl(txtIBprob(x))) Next x For x = 0 To 7 pState(x) = Log(CDbl(txtStateProb(x))) Next x For x = 0 To 1 pInitial(x) = Log(CDbl(txtInitProb(x))) Next x Message "Calculating initial states..." 'Arrays for holding all HMM entries Dim bHMM() As Double, iHMM() As Double ReDim bHMM(0 To lenDNA) As Double ReDim iHMM(0 To lenDNA) As Double 'We use these strings to show the B and I states output by the algorithms Dim sHMM As String sHMM = "" Dim sViterbi As String sViterbi = "" 'Manually perform the first calculation for the first entry bHMM(0) = pState(DNA(0)) + pInitial(0) iHMM(0) = pState(DNA(0) + 4) + pInitial(1) If bHMM(0) > iHMM(0) Then sHMM = sHMM & "B" Else sHMM = sHMM & "I" 'Next, loop through every entry and calulate HMM data as we go For x = 1 To lenDNA - 1 bHMM(x) = pState(DNA(x)) + dMax(bHMM(x - 1) + pIorB(0), iHMM(x - 1) + pIorB(2)) iHMM(x) = pState(DNA(x) + 4) + dMax(iHMM(x - 1) + pIorB(3), bHMM(x - 1) + pIorB(1)) 'Remember states If bHMM(x) > iHMM(x) Then sHMM = sHMM & "B" Else sHMM = sHMM & "I" 'Display a friendly message to let the user know how things are coming If (x Mod 100) = 0 Then Message "Generating HMM (Base " & x & " of " & lenDNA - 1 & ")..." Next x 'Now proceed back through the data and generate Viterbi info Dim bHMM1() As Double Dim bHMM2() As Double Dim iHMM1() As Double Dim iHMM2() As Double ReDim bHMM1(0 To lenDNA) As Double ReDim bHMM2(0 To lenDNA) As Double ReDim iHMM1(0 To lenDNA) As Double ReDim iHMM2(0 To lenDNA) As Double 'Assemble initial Viterbi data For x = 1 To lenDNA - 1 'Another friendly message If (x Mod 100) = 0 Then Message "Generating Viterbi data (Base " & x & " of " & lenDNA - 1 & ")..." bHMM1(x) = bHMM(x - 1) + pIorB(0) bHMM2(x) = iHMM(x - 1) + pIorB(2) iHMM1(x) = bHMM(x - 1) + pIorB(1) iHMM2(x) = iHMM(x - 1) + pIorB(3) Next x 'Next comes the Viterbi algorithm itself ReDim vHMM(0 To lenDNA) As Double Dim totalI As Long, totalB As Long If bHMM(lenDNA - 1) > iHMM(lenDNA - 1) Then vHMM(lenDNA - 1) = 0 sViterbi = "B" totalB = totalB + 1 Else vHMM(lenDNA - 1) = 1 sViterbi = "I" totalI = totalI + 1 End If For x = lenDNA - 2 To 0 Step -1 'Who doesn't like friendly messages? If (x Mod 100) = 0 Then Message "Performing Viterbi algorithm (Base " & x & " of " & lenDNA - 1 & ")..." If vHMM(x + 1) = 0 Then If bHMM1(x + 1) > bHMM2(x + 1) Then sViterbi = "B" & sViterbi vHMM(x) = 0 totalB = totalB + 1 Else sViterbi = "I" & sViterbi vHMM(x) = 1 totalI = totalI + 1 End If Else If iHMM1(x + 1) > iHMM2(x + 1) Then sViterbi = "B" & sViterbi vHMM(x) = 0 totalB = totalB + 1 Else sViterbi = "I" & sViterbi vHMM(x) = 1 totalI = totalI + 1 End If End If Next x 'Display the results of our analysis and encourage the user to continue with step 4 txtTest = "Raw HMM analysis: " & vbCrLf & sHMM & vbCrLf & vbCrLf & "Viterbi analysis: " & vbCrLf & sViterbi lblStep3Results.Caption = "Results: " & CSng(totalB) / (totalB + totalI) * 100 & "% B, " & CSng(totalI) / (totalB + totalI) * 100 & "% I" Message "Step 3 completed successfully. Please proceed with Step 4." cmdWindow.Enabled = True End Sub 'Handy routine for processing a FASTA file Private Sub cmdOpenFASTA_Click() 'Simple open dialog Dim newDialog As pdOpenSaveDialog Set newDialog = New pdOpenSaveDialog Dim sFile As String If newDialog.GetOpenFileName(sFile,, True,, "FASTA files (*.fas, *.fasta)|*.fas;*.fasta|All files|*.*",,, "Open a FASTA file",, frmMain.hWnd) Then Message "Opening FASTA file..." lblFile.Caption = "Current file: " & sFile Dim fNum As Long fNum = FreeFile Open sFile For Input As #fNum 'This is an arbitrary "default" max # of lines in the file eFile = 100 ReDim fText(0 To eFile) As String 'Temporary line read from the file Dim hInfo As String 'Total length of all lines Dim numChars As Long 'Total number of lines Dim numOfLines As Long numOfLines = -1 Message "Reading in FASTA data..." 'Read through to the end of the file Do While Not EOF(fNum) Line Input #fNum, hInfo hInfo = Trim(hInfo) 'Line width must be greater than 0 and not a FASTA comment line If (Len(hInfo) > 0) And Not (Left(hInfo, 1) = ">") Then numOfLines = numOfLines + 1 'If the current line exceeds the maximum number of lines allowed, double the size of the 'array and continue onward. If numOfLines > eFile Then eFile = eFile * 2 ReDim Preserve fText(0 To eFile) As String End If fText(numOfLines) = LCase(hInfo) 'Make EVERYTHING lowercase (to simplify text comparisons) numChars = numChars + Len(hInfo) End If Loop 'Close the file Close #fNum 'Resize our array to the minimum size necessary ReDim Preserve fText(0 To numOfLines) As String ReDim DNA(0 To numChars) As Byte 'Prepare to convert the FASTA from text to numbers Dim curChar As Long curChar = 0 aTot = 0 cTot = 0 gTot = 0 tTot = 0 Dim entry As String * 1 Message "Converting FASTA data to byte data for HMM analysis..." 'Travel through each line, converting the FASTA data as we go For x = 0 To numOfLines 'On each line, travel through each character individually For y = 1 To Len(fText(x)) 'Grab the current character entry = Mid(fText(x), y, 1) Select Case entry 'Convert A/C/G/T to numbers, and count how many total A's, C's, G's, T's we have Case "a" DNA(curChar) = 0 aTot = aTot + 1 Case "c" DNA(curChar) = 1 cTot = cTot + 1 Case "g" DNA(curChar) = 2 gTot = gTot + 1 Case "t" DNA(curChar) = 3 tTot = tTot + 1 'Ignore anything that isn't A/C/G/T Case Else Message "FASTA ERROR: a character other than a, c, g, t was detected (" & entry & ")." curChar = curChar - 1 End Select curChar = curChar + 1 Next y Next x lenDNA = curChar Message "Step 1 completed successfully. Please begin Step 2, and when complete, please click the Step 3 button." cmdHMM.Enabled = True End If End Sub 'Displays relevant messages at the bottom of the screen Private Sub Message(ByRef iMessage As String) lblMessage.Caption = " " & iMessage lblMessage.Refresh DoEvents End Sub 'Determine the larger of two Double-type variables Private Function dMax(ByVal d1 As Double, ByVal d2 As Double) As Double If (d1 > d2) Then dMax = d1 Else dMax = d2 End Function 'This routine performs a sliding window analysis of the HMM/Viterbi data Private Sub cmdWindow_Click() Dim winSize As Long winSize = CLng(txtWindowSize) Dim wResults() As Long ReDim wResults(0 To lenDNA - winSize) As Long 'Observed vs expected ratio of C/G content Dim oeResults() As Single ReDim oeResults(0 To lenDNA - winSize) As Single 'Calculate an expected value Dim CGexpected As Single CGexpected = (cTot + gTot) / (cTot + gTot + aTot + tTot) Dim cgCount As Single Dim cgMax As Single cgMax = 0 Dim tCount As Long Dim iMax As Long, iMin As Long iMax = 0 iMin = winSize 'Travel through the data, calculating sliding window values as we go For x = 0 To UBound(wResults) 'Reset the I counter tCount = 0 'Reset the c/g observed count cgCount = 0 If (x Mod 100) = 0 Then Message "Analyzing window " & x & " of " & UBound(wResults) 'Analyze this sliding window For y = x To x + winSize If vHMM(y) = 1 Then tCount = tCount + 1 If DNA(y) = 1 Or DNA(y) = 2 Then cgCount = cgCount + 1 Next y 'Store the value of this sliding window wResults(x) = tCount cgCount = cgCount / (winSize * CGexpected) oeResults(x) = cgCount If cgCount > cgMax Then cgMax = cgCount If tCount > iMax Then iMax = tCount If tCount < iMin Then iMin = tCount Next x Dim tIndex As Single lblPercent.Caption = " I/B Ratio (Maximum = " & iMax / winSize & "): " lblCGHeader.Caption = " C/G Observed vs. Expected (Maximum = " & cgMax & "):" 'Draw the results For x = 0 To picResults.ScaleWidth tIndex = (x / picResults.ScaleWidth) * UBound(wResults) picResults.Line (x + 1, 0)-(x + 1, picResults.ScaleHeight), RGB(255, 0, 0) picOE.Line (x + 1, 0)-(x + 1, picOE.ScaleHeight), RGB(255, 0, 0) 'Percentage plot picResults.Line (x, 0)-(x, picResults.ScaleHeight), RGB(255, 255, 255) picResults.Line (x, picResults.ScaleHeight)-(x, picResults.ScaleHeight - (CSng(wResults(tIndex)) / CSng(iMax)) * picResults.ScaleHeight) 'O/E plot picOE.Line (x, 0)-(x, picOE.ScaleHeight), RGB(255, 255, 255) picOE.Line (x, picOE.ScaleHeight)-(x, picOE.ScaleHeight - (CSng(oeResults(tIndex)) / CSng(cgMax)) * picOE.ScaleHeight) picResults.Refresh picOE.Refresh DoEvents Next x 'Lastly, let's attempt to locate an island For x = 0 To UBound(wResults) If wResults(x) > (iMax * 0.9) Then y = x + 1 Do While wResults(y) > (iMax * 0.8) y = y + 1 Loop 'See how far our search went If (y + winSize - x) > 200 Then lblRecommendation.Caption = "There is a likely CpG island from base " & x & " to base " & y + winSize & "." tIndex = (x / UBound(wResults)) * picResults.ScaleWidth picResults.Line (tIndex, 0)-(tIndex, picResults.ScaleHeight), RGB(255, 0, 0) picOE.Line (tIndex, 0)-(tIndex, picOE.ScaleHeight), RGB(255, 0, 0) tIndex = (y / UBound(wResults)) * picResults.ScaleWidth picResults.Line (tIndex, 0)-(tIndex, picResults.ScaleHeight), RGB(255, 0, 0) picOE.Line (tIndex, 0)-(tIndex, picOE.ScaleHeight), RGB(255, 0, 0) GoTo NoMoreLook End If End If Next x lblRecommendation.Caption = "No potential CpG islands were found (minimum length = " & winSize & " bases)" NoMoreLook: Message " Sliding window analyses are complete." End Sub ======================= File: Histograms-basic/Main.frm ======================= VERSION 5.00 Begin VB.Form frmMain AutoRedraw = -1 'True BackColor = &H80000005& Caption = "Image Histograms Demo - www.tannerhelland.com" ClientHeight = 5190 ClientLeft = 60 ClientTop = 630 ClientWidth = 6255 BeginProperty Font Name = "Arial" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty LinkTopic = "Form1" ScaleHeight = 346 ScaleMode = 3 'Pixel ScaleWidth = 417 StartUpPosition = 2 'CenterScreen Begin VB.CommandButton cmdDispHistogram Caption = "Display histogram" Height = 375 Left = 120 TabIndex = 1 Top = 120 Width = 2655 End Begin VB.PictureBox PicMain Appearance = 0 'Flat AutoRedraw = -1 'True BackColor = &H80000005& BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 4530 Left = 120 ScaleHeight = 300 ScaleMode = 3 'Pixel ScaleWidth = 400 TabIndex = 0 Top = 600 Width = 6030 End Begin VB.PictureBox PicBack Appearance = 0 'Flat AutoRedraw = -1 'True AutoSize = -1 'True BackColor = &H80000005& BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 4530 Left = 120 ScaleHeight = 300 ScaleMode = 3 'Pixel ScaleWidth = 400 TabIndex = 2 Top = 600 Visible = 0 'False Width = 6030 End Begin VB.Menu MnuFile Caption = "&File" Begin VB.Menu MnuOpenImage Caption = "&Open Image" End End End Attribute VB_Name = "frmMain" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False '*************************************************************************** 'Copyright 2018 by <NAME> ' www.tannerhelland.com ' 'Documentation for this project can be found at https://tannerhelland.com/code/ ' 'The source code in this project is licensed under a Simplified BSD license. ' For more information, please review LICENSE.md at https://github.com/tannerhelland/thdc-code/ ' 'If you find this code useful, please consider a small donation to https://www.paypal.me/TannerHelland ' '*************************************************************************** Option Explicit 'The histogram information is displayed on a separate form (launch from button) Private Sub cmdDispHistogram_Click() frmHistogram.Show End Sub 'Automatically initialized Private Sub Form_Load() 'Upon loading the form, reset two variables: 'Luminance is the default histogram source lastHistSource = DRAWMETHOD_LUMINANCE 'Line graph is the default drawing option lastHistMethod = DRAWMETHOD_BARS 'Draw the initial effect with a default value, then update the image If (App.LogMode = 0) Then Me.Caption = Me.Caption & " - compile for significantly better performance!" LoadImageAutosized App.Path & "\sample.jpg" Me.Show frmHistogram.Show 0, Me End Sub Private Sub MnuOpenImage_Click() 'Windows common dialog interface Dim cDialog As pdOpenSaveDialog Set cDialog = New pdOpenSaveDialog 'VB6's built-in image loader (which wraps an ancient OLE loader) only supports a 'subset of modern image file types. Dim cdfStr As String cdfStr = "All Compatible Graphics|*.bmp;*.jpg;*.jpeg;*.gif;*.wmf;*.emf|" cdfStr = cdfStr & "BMP - Windows Bitmap|*.bmp|EMF - Enhanced Metafile|*.emf|GIF - Compuserve|*.gif|JPG/JPEG - JFIF Compliant|*.jpg;*.jpeg|WMF - Windows Meta File|*.wmf|All files|*.*" Dim sFile As String If cDialog.GetOpenFileName(sFile,, True, False, cdfStr,,, "Select image",, Me.hWnd) Then LoadImageAutosized sFile End If End Sub 'If a null string is passed, simply paint an unmodified copy of the backbuffer into the foreground buffer Private Sub LoadImageAutosized(Optional ByVal srcFilePath As String = vbNullString) If (LenB(srcFilePath) <> 0) Then PicBack.Picture = LoadPicture(srcFilePath) 'Copy the image, automatically resized, from the background picture box to the foreground one Dim fDraw As FastDrawing Set fDraw = New FastDrawing Dim imageData() As Byte, imgWidth As Long, imgHeight As Long imgWidth = fDraw.GetImageWidth(Me.PicBack) imgHeight = fDraw.GetImageHeight(Me.PicBack) fDraw.GetImageData2D Me.PicBack, imageData() Me.PicMain.Width = imgWidth + 2 Me.PicMain.Height = imgHeight + 2 fDraw.SetImageData2D Me.PicMain, imgWidth, imgHeight, imageData() 'Resize the form to automatically contain the new picture box dimensions. '(This performs some sloppy checks to keep the form from resizing larger than the primary display, ' but it is *not* good code - a proper solution would involve the AdjustWindowRect() API or similar!) Dim newWidth As Long, minWidth As Long minWidth = (cmdDispHistogram.Left + cmdDispHistogram.Width + 20) * Screen.TwipsPerPixelX If (imgWidth < (Screen.Width \ Screen.TwipsPerPixelX) - 50) Then newWidth = (imgWidth + PicMain.Left * 4) * Screen.TwipsPerPixelX If (newWidth < minWidth) Then newWidth = minWidth Me.Width = newWidth End If If (imgHeight < (Screen.Height \ Screen.TwipsPerPixelY) - 50) Then Me.Height = (imgHeight + PicMain.Top * 3) * Screen.TwipsPerPixelY End Sub ======================= File: Screen-capture/FormScreenCapture.frm ======================= VERSION 5.00 Begin VB.Form FormScreenCapture AutoRedraw = -1 'True BackColor = &H00C0C0C0& Caption = "Screen Capture Demo - www.tannerhelland.com" ClientHeight = 3600 ClientLeft = 60 ClientTop = 345 ClientWidth = 6675 KeyPreview = -1 'True LinkTopic = "Form1" ScaleHeight = 240 ScaleMode = 3 'Pixel ScaleWidth = 445 StartUpPosition = 2 'CenterScreen Begin VB.Label Label2 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Screen Capture Demo -- www.tannerhelland.com" BeginProperty Font Name = "Arial" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00FFFFFF& Height = 210 Left = 120 TabIndex = 1 Top = 240 Width = 3615 End Begin VB.Label Label1 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Screen Capture Demo -- www.tannerhelland.com" BeginProperty Font Name = "Arial" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 210 Left = 135 TabIndex = 0 Top = 255 Width = 3615 End End Attribute VB_Name = "FormScreenCapture" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False '*************************************************************************** 'Copyright 2018 by <NAME> ' www.tannerhelland.com ' 'Documentation for this project can be found at https://tannerhelland.com/code/ ' 'The source code in this project is licensed under a Simplified BSD license. ' For more information, please review LICENSE.md at https://github.com/tannerhelland/thdc-code/ ' 'If you find this code useful, please consider a small donation to https://www.paypal.me/TannerHelland ' '*************************************************************************** 'This gives us the hWnd (window handle) of the screen Private Declare Function GetDesktopWindow Lib "user32" () As Long 'This assigns an hDC (device context handle) from an hWnd Private Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long 'BitBlt lets us draw an image from a hDC to another hDC (in our case, from an hDC of the screen capture to the hDC of a VB picture box) Private Declare Function BitBlt Lib "gdi32" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal opCode As Long) As Long 'ReleaseDC is used to free the hDC we generate for the screen capture. Private Declare Function ReleaseDC Lib "user32" (ByVal hWnd As Long, ByVal hDC As Long) As Long 'This sample project copies the screen when the form loads; you could also place this code in a command button (or any other input) Private Sub Form_Load() 'First, minimize this window Me.WindowState = vbMinimized 'Get the hWnd of the screen Dim scrHwnd As Long scrHwnd = GetDesktopWindow 'Now, assign an hDC to the hWnd we generated Dim shDC As Long shDC = GetDC(scrHwnd) 'Determine the size of the screen Dim screenWidth As Long, screenHeight As Long screenWidth = Screen.Width \ Screen.TwipsPerPixelX screenHeight = Screen.Height \ Screen.TwipsPerPixelY 'Copy the pixel data from the screen into our form BitBlt Me.hDC, 0, 0, screenWidth, screenHeight, shDC, 0, 0, vbSrcCopy 'Release our hold on the screen DC ReleaseDC scrHwnd, shDC Me.Picture = Me.Image 'Restore the window Me.WindowState = vbNormal End Sub ======================= File: Map-editor-2D/Declarations.bas ======================= <filename>Map-editor-2D/Declarations.bas Attribute VB_Name = "Sub_Module" '*************************************************************************** 'Copyright 2018 by <NAME> ' www.tannerhelland.com ' 'Documentation for this project can be found at https://tannerhelland.com/code/ ' 'The source code in this project is licensed under a Simplified BSD license. ' For more information, please review LICENSE.md at https://github.com/tannerhelland/thdc-code/ ' 'If you find this code useful, please consider a small donation to https://www.paypal.me/TannerHelland ' '*************************************************************************** 'This routine is run when the program starts up Public Sub InitializeEditor() 'Default tiles are nasty brown school carpet on the left, water (?) on the right CurPicIndex = 0 CurPicIndex2 = 1 'Our default map size is 20 tiles by 20 tiles SizeX = 20 SizeY = 20 ReDim MapArray(0 To SizeX, 0 To SizeY) As Byte 'Set the default zoom to 100% (64, or the size of our tiles) Zoom = 64 'Set appropriate values for the main scroll bars Main.HSTileBar.Max = Abs(Main.PicTiles.ScaleWidth - Main.PicTilesBuffer.ScaleWidth) / 64 Main.HSMain.Max = (SizeX * Zoom) - Main.MainPic.ScaleWidth Main.VSMain.Max = (SizeY * Zoom) - Main.MainPic.ScaleHeight 'Initialize the map array For x = 0 To SizeX For Y = 0 To SizeY MapArray(x, Y) = 0 Next Y Next x 'Show the form and draw everything to it Main.Show RefreshAll End Sub 'Render the current map data to the main picture box Public Sub DrawMap() 'Clear out the current map Main.MainPic.Picture = LoadPicture(vbNullString) For x = 0 To SizeX For Y = 0 To SizeY 'For speed purposes, it would be better to remove this "If/Then" statement to be outside the loop. 'However, in an editor environment this is somewhat unimportant. If UseStretchBlt Then StretchBlt Main.MainPic.hdc, (x * Zoom) - ViewX, (Y * Zoom) - ViewY, Zoom, Zoom, Main.PicTilesBuffer.hdc, MapArray(x, Y) * 64, 0, 64, 64, vbSrcCopy Else Main.MainPic.PaintPicture Main.PicTilesBuffer.Picture, (x * Zoom) - ViewX, (Y * Zoom) - ViewY, Zoom, Zoom, MapArray(x, Y) * 64, 0, 64, 64, vbSrcCopy End If Next Y Next x 'Because AutoRedraw is set to true for our main map, update the.Picture property and force a refresh Main.MainPic.Picture = Main.MainPic.Image Main.MainPic.Refresh End Sub 'When scrollbars are used, set the new viewport and redraw the map Public Sub ScrollMap() ViewX = Main.HSMain.Value ViewY = Main.VSMain.Value DrawMap End Sub 'This routine copies the correct tileset from the invisible buffer to the visible bar Public Sub DrawTileBar() If UseStretchBlt Then StretchBlt Main.PicTiles.hdc, 0, 0, Main.PicTiles.ScaleWidth, 64, Main.PicTilesBuffer.hdc, Main.HSTileBar.Value * 64, 0, Main.PicTiles.ScaleWidth, 64, vbSrcCopy Else Main.PicTiles.PaintPicture Main.PicTilesBuffer.Picture, 0, 0, Main.PicTiles.ScaleWidth, 64, Main.HSTileBar.Value * 64, 0, Main.PicTiles.ScaleWidth, 64, vbSrcCopy End If Main.MainPic.Picture = Main.MainPic.Image Main.MainPic.Refresh End Sub 'Draw a tile of type "ArrayIndex" at location (x, y) Public Sub DrawTile(ByVal x As Integer, ByVal Y As Integer, ByVal ArrayIndex As Byte) 'Calculate the actual x and y values (accounting for zoom and scrolling) CurX = (x \ Zoom) + (ViewX \ Zoom) CurY = (Y \ Zoom) + (ViewY \ Zoom) 'If the user moved the mouse outside of the map dimensions, cancel this routine If CurX > SizeX Or CurY > SizeY Or CurX < 0 Or CurY < 0 Then Exit Sub 'Store this tile value in MapArray MapArray(CurX, CurY) = ArrayIndex 'Draw the new tile If UseStretchBlt Then StretchBlt Main.MainPic.hdc, (CurX * Zoom) - ViewX, (CurY * Zoom) - ViewY, Zoom, Zoom, Main.PicTilesBuffer.hdc, ArrayIndex * 64, 0, 64, 64, vbSrcCopy Else Main.MainPic.PaintPicture Main.PicTilesBuffer.Picture, (CurX * Zoom) - ViewX, (CurY * Zoom) - ViewY, Zoom, Zoom, ArrayIndex * 64, 0, 64, 64, vbSrcCopy End If Main.MainPic.Picture = Main.MainPic.Image Main.MainPic.Refresh End Sub 'If the zoom is changed, update all scrollbars and draw the new, properly zoomed map Public Sub ChangeZoom() 'Get a new zoom value from the user Zoom = InputBox("Enter the percent zoom (100 is default)") Zoom = Int((Zoom / 100) * 64) 'Change the scroll bars depending on the new zoom value If (SizeX * Zoom) < Main.MainPic.ScaleWidth Then Main.HSMain.Value = 0 Main.HSMain.Enabled = False Else Main.HSMain.Enabled = True Main.HSMain.Max = (SizeX * Zoom) - Main.MainPic.ScaleWidth End If If (SizeY * Zoom) < Main.MainPic.ScaleHeight Then Main.VSMain.Value = 0 Main.VSMain.Enabled = False Else Main.VSMain.Enabled = True Main.VSMain.Max = (SizeY * Zoom) - Main.MainPic.ScaleHeight End If 'Draw the new map image DrawMap End Sub 'As you may have guessed, this routine refreshes everything on the screen Public Sub RefreshAll() If UseStretchBlt Then StretchBlt Main.Pic1.hdc, 0, 0, 64, 64, Main.PicTilesBuffer.hdc, CurPicIndex * 64, 0, 64, 64, vbSrcCopy StretchBlt Main.Pic2.hdc, 0, 0, 64, 64, Main.PicTilesBuffer.hdc, CurPicIndex2 * 64, 0, 64, 64, vbSrcCopy Else Main.Pic1.PaintPicture Main.PicTilesBuffer.Picture, 0, 0, 64, 64, CurPicIndex * 64, 0, 64, 64, vbSrcCopy Main.Pic2.PaintPicture Main.PicTilesBuffer.Picture, 0, 0, 64, 64, CurPicIndex2 * 64, 0, 64, 64, vbSrcCopy End If DrawTileBar DrawMap End Sub ======================= File: Mandelbrot/Mandelbrot.frm ======================= VERSION 5.00 Begin VB.Form frmFractal BackColor = &H80000005& Caption = "Mandelbrot Fractal Demo - www.tannerhelland.com" ClientHeight = 10575 ClientLeft = 60 ClientTop = 345 ClientWidth = 9255 BeginProperty Font Name = "Arial" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty LinkTopic = "Form1" ScaleHeight = 705 ScaleMode = 3 'Pixel ScaleWidth = 617 StartUpPosition = 2 'CenterScreen Begin VB.CommandButton CmdReset Appearance = 0 'Flat Caption = "Reset" Height = 615 Left = 8280 TabIndex = 14 Top = 480 Width = 855 End Begin VB.HScrollBar scrAccuracy Height = 255 Left = 1200 Max = 20 Min = 1 TabIndex = 10 Top = 90 Value = 1 Width = 6255 End Begin VB.CommandButton CmdRedraw Appearance = 0 'Flat Caption = "Draw the Fractal" Height = 615 Left = 6120 TabIndex = 5 Top = 480 Width = 2055 End Begin VB.TextBox TxtYMax Appearance = 0 'Flat BeginProperty Font Name = "Arial" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 330 Left = 4560 TabIndex = 4 Text = "1.5" Top = 720 Width = 1365 End Begin VB.TextBox TxtYMin Appearance = 0 'Flat BeginProperty Font Name = "Arial" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 330 Left = 3120 TabIndex = 3 Text = "-1.5" Top = 720 Width = 1365 End Begin VB.TextBox TxtXMax Appearance = 0 'Flat BeginProperty Font Name = "Arial" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 330 Left = 1560 TabIndex = 2 Text = ".75" Top = 720 Width = 1365 End Begin VB.TextBox TxtXMin Appearance = 0 'Flat BeginProperty Font Name = "Arial" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 330 Left = 120 TabIndex = 1 Text = "-1.75" Top = 720 Width = 1365 End Begin VB.PictureBox PicDraw Appearance = 0 'Flat AutoRedraw = -1 'True BackColor = &H80000005& ForeColor = &H80000008& Height = 9015 Left = 120 ScaleHeight = 599 ScaleMode = 3 'Pixel ScaleWidth = 599 TabIndex = 0 Top = 1440 Width = 9015 End Begin VB.Label Label7 Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "Use the mouse to click-drag new bound values. (Press the ""draw"" button above after selecting a new frame of reference.)" ForeColor = &H80000008& Height = 255 Left = 120 TabIndex = 13 Top = 1200 Width = 9015 End Begin VB.Label Label6 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Accurate shading" Height = 210 Left = 7560 TabIndex = 12 Top = 120 Width = 1290 End Begin VB.Label Label5 Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "Fast shading" ForeColor = &H80000008& Height = 255 Left = 120 TabIndex = 11 Top = 120 Width = 1095 End Begin VB.Label Label4 BackStyle = 0 'Transparent Caption = "Y Max:" Height = 255 Left = 4560 TabIndex = 9 Top = 480 Width = 735 End Begin VB.Label Label3 BackStyle = 0 'Transparent Caption = "Y Min:" Height = 255 Left = 3120 TabIndex = 8 Top = 480 Width = 735 End Begin VB.Label Label2 BackStyle = 0 'Transparent Caption = "X Max:" Height = 255 Left = 1560 TabIndex = 7 Top = 480 Width = 735 End Begin VB.Label Label1 BackStyle = 0 'Transparent Caption = "X Min:" Height = 255 Left = 120 TabIndex = 6 Top = 480 Width = 735 End End Attribute VB_Name = "frmFractal" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False '*************************************************************************** 'Copyright 2018 by <NAME> ' www.tannerhelland.com ' 'Documentation for this project can be found at https://tannerhelland.com/code/ ' 'The source code in this project is licensed under a Simplified BSD license. ' For more information, please review LICENSE.md at https://github.com/tannerhelland/thdc-code/ ' 'If you find this code useful, please consider a small donation to https://www.paypal.me/TannerHelland ' '*************************************************************************** 'These dimensions relate to using the mouse to select new bounding areas Dim iX As Double, iY As Double Dim tX As Double, tY As Double Dim iWidth As Double, iHeight As Double Dim toDraw As Boolean 'This array stores the values of the fractal as they're calculated Dim mFractal() As Double 'This number (set by the corresponding scrollbar) takes on values between 100 and 2000 'Higher numbers = more accurate/slow; lower mumbers = less accurate/fast Dim IterationLimit As Long 'Simple API declaration for drawing pixels Private Declare Function SetPixelV Lib "gdi32" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Byte 'DRAW THE FRACTAL Private Sub CmdRedraw_Click() 'Lots of variables are required for fractal-drawing Dim drawWidth As Long, drawHeight As Long Dim count As Double Dim red As Long, green As Long, blue As Long Dim minX As Double, maxX As Double, minY As Double, maxY As Double Dim calcX As Double, calcY As Double, stepX As Double, stepY As Double Dim color As Long Dim loValue As Double, hiValue As Double loValue = 2000000000# hiValue = -2000000000# 'Reset the mouse values after each draw (since no box is present after drawing) iX = -1 iY = -1 tX = -1 tY = -1 'Prepare the picture box using hard-coded size values. (Feel free to change these.) drawWidth = 600 drawHeight = 600 PicDraw.Width = drawWidth + 2 PicDraw.Height = drawHeight + 2 PicDraw.Refresh DoEvents 'Set minimum and maximum view windows based on corresponding text box values minX = Val(TxtXMin) maxX = Val(TxtXMax) minY = Val(TxtYMin) maxY = Val(TxtYMax) 'Create a conversion between the Mandlebrot set window and the actual pixels where the fractal will appear stepX = Abs(maxX - minX) / drawWidth stepY = Abs(maxY - minY) / drawHeight 'Resize the fractal array ReDim mFractal(0 To drawWidth, 0 To drawHeight) As Double 'Run a loop through each pixel, calculating Mandelbrot values as we go calcX = minX calcY = minY Dim x As Long, y As Long Dim rootCount As Double For y = 0 To drawHeight For x = 0 To drawWidth 'This main recursive function is what actually calculates the fractal values count = Calculate(calcX, calcY, 0, 0, 0) rootCount = Sqr(count) 'Keep track of the highest and lowest values encountered so far (to help with rendering) If rootCount < loValue Then loValue = rootCount Else If rootCount > hiValue Then hiValue = rootCount End If 'Store the fractal value in the array mFractal(x, y) = rootCount calcX = calcX + stepX Next x calcX = minX calcY = calcY + stepY 'Give the user some indication of how close we are to finishing CmdRedraw.Caption = Int((y / drawHeight) * 100) & "% Complete" Next y 'Once the fractal values have been saved, calculate the difference between the lowest and highest values Dim lohiDif As Double lohiDif = hiValue - loValue If lohiDif = 0# Then lohiDif = 0.0000000001 'Draw the fractal For y = 0 To drawHeight For x = 0 To drawWidth 'Convert the fractal value to a 0-255 RGB value count = Int(((mFractal(x, y) - loValue) / lohiDif) * 255# + 0.5) 'Make the highest values pure white (looks better, IMO) If mFractal(x, y) = hiValue Then red = 255 green = 255 blue = 255 Else 'I use this simple color formula to make the fractal shades of violet instead of just gray red = count green = count \ 2 blue = count * 2 If blue > 255 Then blue = 255 End If 'Draw this pixel SetPixelV PicDraw.hDC, x, y, RGB(red, green, blue) Next x 'Refresh the image every 16 lines If y And 15 = 0 Then PicDraw.Refresh Next y 'Final image refresh PicDraw.Refresh 'Restore the command button text CmdRedraw.Caption = "Redraw the Fractal" End Sub Private Sub CmdReset_Click() toDraw = False TxtXMin.Text = "-1.75" TxtXMax.Text = ".75" TxtYMin.Text = "-1.5" TxtYMax.Text = "1.5" IterationLimit = 400 iX = -1 iY = -1 tX = -1 tY = -1 CmdRedraw_Click End Sub 'ON STARTUP: set various variables to proper default values Private Sub Form_Load() toDraw = False IterationLimit = 400 iX = -1 iY = -1 tX = -1 tY = -1 End Sub 'MOUSE DOWN: on the main picture box Private Sub PicDraw_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) 'Erase any previous boxes the user may have drawn PicDraw.DrawMode = 6 PicDraw.Line (tX, tY)-(tX, iY) PicDraw.Line (tX, tY)-(iX, tY) PicDraw.Line (iX, iY)-(tX, iY) PicDraw.Line (iX, iY)-(iX, tY) PicDraw.DrawMode = 13 'Note the current location and mark a mouse button as being "down" iX = x iY = y tX = x tY = y toDraw = True End Sub 'MOUSE MOVE: on the main picture box Private Sub PicDraw_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single) 'If a mouse button has been pressed, draw a rectangle around the current selection area If toDraw Then 'Set the draw style to "invert" PicDraw.DrawMode = 6 'Erase the old box PicDraw.Line (tX, tY)-(tX, iY) PicDraw.Line (tX, tY)-(iX, tY) PicDraw.Line (iX, iY)-(tX, iY) PicDraw.Line (iX, iY)-(iX, tY) 'Draw a new box PicDraw.Line (iX, iY)-(iX, y) PicDraw.Line (iX, iY)-(x, iY) PicDraw.Line (x, y)-(iX, y) PicDraw.Line (x, y)-(x, iY) 'Remember where this box is located tX = x tY = y 'Reset the draw style to "copy" PicDraw.DrawMode = 13 End If End Sub 'MOUSE UP: on the main picture box Private Sub PicDraw_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single) 'Mark the mouse button as being released toDraw = False 'Figure out the width and height of the selected area iWidth = x - iX iHeight = y - iY 'Use some fancy math to calculate the approximate reference frame that the user has selected. '(Basically, translate the pixel width on-screen to the coordinate system used by Mandelbrot.) Dim nX As Double, nY As Double Dim oX As Double, oY As Double Dim oSX As Double, oEX As Double Dim oSY As Double, oEY As Double nX = x nY = y oSX = TxtXMin oEX = TxtXMax oSY = TxtYMin oEY = TxtYMax oX = (iX / PicDraw.ScaleWidth) * (TxtXMax - TxtXMin) oX = oSX + oX oY = (iY / PicDraw.ScaleHeight) * (TxtYMax - TxtYMin) oY = oSY + oY nX = (nX / PicDraw.ScaleWidth) * (TxtXMax - TxtXMin) nX = oSX + nX nY = (nY / PicDraw.ScaleHeight) * (TxtYMax - TxtYMin) nY = oSY + nY 'Change the text boxes to match our new frame of reference TxtXMin = oX TxtXMax = nX TxtYMin = oY TxtYMax = nY End Sub 'SCROLLBAR: for changing the accuracy / speed of the fractal render Private Sub scrAccuracy_Change() IterationLimit = scrAccuracy.Value * 100 End Sub 'Here is a standard recursive function for generating the Mandlebrot set. Technical details are available at the Wikipedia link referenced earlier. Private Function Calculate(ByVal origX As Double, ByVal origY As Double, ByVal curX As Double, ByVal curY As Double, ByVal counter As Long) As Long Static NewX As Double, NewY As Double 'Check for overflow (well, technically "underflow" :) If curX < -1000000 Then Calculate = counter Exit Function ElseIf curY < -1000000 Then Calculate = counter Exit Function End If 'If you so desire, you can also remove the if/then statements above and let VB do the underflow checking (uncomment this next line to allow) 'On Error GoTo 1 NewX = (curX * curX) - (curY * curY) + origX NewY = (2 * curX * curY) + origY If ((NewX * NewX) - (NewY * NewY)) > 2 Then 1 Calculate = counter Else 'This line checks to see if we've exceeded the "IterationLimit" (IterationLimit controls accuracy / speed of execution) If counter >= IterationLimit Then Calculate = IterationLimit Else counter = counter + 1 Calculate = Calculate(origX, origY, NewX, NewY, counter) End If End If End Function ======================= File: Fill-image-region/frmFill.frm ======================= <reponame>xxdoc/vb6-code VERSION 5.00 Begin VB.Form frmFill Appearance = 0 'Flat AutoRedraw = -1 'True BackColor = &H80000005& Caption = "Fill Image Regions Demo - www.tannerhelland.com" ClientHeight = 6615 ClientLeft = 60 ClientTop = 345 ClientWidth = 7845 DrawWidth = 3 FillStyle = 0 'Solid BeginProperty Font Name = "Arial" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00000000& LinkTopic = "Form1" ScaleHeight = 441 ScaleMode = 3 'Pixel ScaleWidth = 523 StartUpPosition = 3 'Windows Default Begin VB.PictureBox picDemo Appearance = 0 'Flat BackColor = &H80000005& DrawWidth = 3 FillStyle = 0 'Solid BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 6015 Left = 120 ScaleHeight = 399 ScaleMode = 3 'Pixel ScaleWidth = 503 TabIndex = 1 Top = 480 Width = 7575 End Begin VB.Label lblInstructions Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "Use the left mouse button to draw lines, and the right button to fill a region with color." BeginProperty Font Name = "Arial" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 255 Left = 120 TabIndex = 0 Top = 120 Width = 7575 End End Attribute VB_Name = "frmFill" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False '*************************************************************************** 'Copyright 2018 by <NAME> ' www.tannerhelland.com ' 'Documentation for this project can be found at https://tannerhelland.com/code/ ' 'The source code in this project is licensed under a Simplified BSD license. ' For more information, please review LICENSE.md at https://github.com/tannerhelland/thdc-code/ ' 'If you find this code useful, please consider a small donation to https://www.paypal.me/TannerHelland ' '*************************************************************************** Private Declare Function ExtFloodFill Lib "gdi32" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long, ByVal wFillType As Long) As Long 'Location variables necessary for drawing connected lines Dim xStart As Long, yStart As Long 'This variable remembers whether or not the left mouse button has been pressed (see below) Dim toDraw As Boolean 'When the left mouse button is pressed... Private Sub picDemo_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) 'Check the mouse button 'If the left button is pressed... If Button = vbLeftButton Then 'Remember that the left-hand button is down toDraw = True 'Remember the current mouse location xStart = x yStart = y 'If the right button... ElseIf Button = vbRightButton Then 'Seed VB's random number generator Randomize Timer 'Set the picture box's.FillColor property to a random number picDemo.FillColor = RGB(Int(Rnd * 255), Int(Rnd * 255), Int(Rnd * 255)) 'Use the API to fill this region 'Parameters: (picture box), (x coordinate), (y coordinate), (color being replaced), (fill method - always 1) ExtFloodFill picDemo.hDC, x, y, picDemo.Point(x, y), 1 End If End Sub 'When the mouse is moved... Private Sub picDemo_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single) 'If drawing is enabled (meaning the left mouse button has previously been pressed), 'draw a line between the old x coordinate and the current one If toDraw Then 'Use VB's line function to draw the line picDemo.Line (xStart, yStart)-(x, y) 'Replace the old xStart and yStart variables with the current location of the mouse xStart = x yStart = y End If End Sub 'When a mouse button is released... Private Sub picDemo_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single) 'Disable drawing toDraw = False End Sub ======================= File: Levels-effect/mod_PublicVars.bas ======================= <reponame>xxdoc/vb6-code Attribute VB_Name = "modPublicVars" 'A couple constants to simplify tracking various variables Public Const DRAWMETHOD_LUMINANCE As Long = 3 Public Const DRAWMETHOD_BARS As Long = 0 'Used to track the last options we used on the histogram form Public lastHistSource As Long, lastHistMethod As Long 'We'll use this routine only to draw the gradient below the histogram window '(like Photoshop does). This code is old, but it works ;) Public Sub DrawGradient(ByRef DstObject As PictureBox, ByVal Color1 As Long, ByVal Color2 As Long) 'RGB() variables for each color Dim R As Long, G As Long, B As Long Dim R2 As Long, G2 As Long, B2 As Long 'Extract the r,g,b values from the colors passed by the user R = Color1 Mod 256 G = (Color1 \ 256) And 255 B = (Color1 \ 65536) And 255 R2 = Color2 Mod 256 G2 = (Color2 \ 256) And 255 B2 = (Color2 \ 65536) And 255 'Calculation variables for the gradiency Dim VR As Single, VG As Single, VB As Single 'Size of the picture box we'll be drawing to Dim iWidth As Long, iHeight As Long iWidth = DstObject.ScaleWidth iHeight = DstObject.ScaleHeight 'Here, create a calculation variable for determining the step between 'each level of the gradient VR = Abs(R - R2) / iWidth VG = Abs(G - G2) / iWidth VB = Abs(B - B2) / iWidth 'If the second value is lower then the first value, make the step negative If R2 < R Then VR = -VR If G2 < G Then VG = -VG If B2 < B Then VB = -VB 'Last, run a loop through the width of the picture box, incrementing the color as 'we go (thus creating a gradient effect) Dim x As Long For x = 0 To iWidth R2 = R + VR * x G2 = G + VG * x B2 = B + VB * x DstObject.Line (x, 0)-(x, iHeight), RGB(R2, G2, B2) Next x End Sub ======================= File: Brightness-effect/Part 4 - Even faster DIBs/Brightness.frm ======================= <filename>Brightness-effect/Part 4 - Even faster DIBs/Brightness.frm VERSION 5.00 Begin VB.Form frmBrightness AutoRedraw = -1 'True BackColor = &H00C0C0C0& Caption = "Brightness Example - Realtime - www.tannerhelland.com" ClientHeight = 5520 ClientLeft = 60 ClientTop = 345 ClientWidth = 6225 BeginProperty Font Name = "Arial" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty LinkTopic = "Form1" ScaleHeight = 368 ScaleMode = 3 'Pixel ScaleWidth = 415 StartUpPosition = 2 'CenterScreen Begin VB.HScrollBar hScrollBrightness Height = 255 Left = 2640 Max = 255 Min = -255 TabIndex = 3 Top = 5160 Width = 3495 End Begin VB.CheckBox ChkMethod Appearance = 0 'Flat BackColor = &H00C0C0C0& Caption = "Use Stream (Fastest)" ForeColor = &H80000008& Height = 255 Left = 120 TabIndex = 2 Top = 4800 Value = 1 'Checked Width = 2295 End Begin VB.PictureBox Picture2 Appearance = 0 'Flat AutoRedraw = -1 'True BackColor = &H80000005& ForeColor = &H80000008& Height = 4530 Left = 120 ScaleHeight = 300 ScaleMode = 3 'Pixel ScaleWidth = 400 TabIndex = 4 Top = 120 Width = 6030 End Begin VB.PictureBox Picture1 Appearance = 0 'Flat AutoRedraw = -1 'True AutoSize = -1 'True BackColor = &H80000005& ForeColor = &H80000008& Height = 4530 Left = 120 Picture = "Brightness.frx":0000 ScaleHeight = 300 ScaleMode = 3 'Pixel ScaleWidth = 400 TabIndex = 0 Top = 120 Width = 6030 End Begin VB.Label Label1 AutoSize = -1 'True BackColor = &H00C0C0C0& Caption = "Brightness Change (-255 to 255):" Height = 210 Left = 120 TabIndex = 1 Top = 5160 Width = 2415 End End Attribute VB_Name = "frmBrightness" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False '*************************************************************************** 'Copyright 2018 by <NAME> ' www.tannerhelland.com ' 'Documentation for this project can be found at https://tannerhelland.com/code/ ' 'The source code in this project is licensed under a Simplified BSD license. ' For more information, please review LICENSE.md at https://github.com/tannerhelland/thdc-code/ ' 'If you find this code useful, please consider a small donation to https://www.paypal.me/TannerHelland ' '*************************************************************************** 'Temporary brightness variable Dim tBrightness As Long 'Subroutine for rapidly altering an image's brightness value (includes progress bar effect) Public Sub DrawBrightness(DstPicture As PictureBox, SrcPicture As PictureBox, ByVal Brightness As Long) Dim NewColor As Long Dim x As Long, y As Long 'Image data Dim iArray() As Byte Dim bTable(0 To 255) As Long 'Build a look-up table of all 256 possible brightness values For x = 0 To 255 NewColor = x + Brightness ByteMe NewColor bTable(x) = NewColor Next x 'Instantiate a FastDrawing class Dim fDraw As New FastDrawing 'Get the image information fDraw.GetImageData SrcPicture, iArray() 'Temporary width and height variables are faster Dim TempWidth As Long, TempHeight As Long 'I don't know why the width must always be (width - 1); this seems to be a 'strange byproduct of using DIB sections in VB. Go figure. TempWidth = fDraw.GetImageWidth(SrcPicture) - 1 TempHeight = fDraw.GetImageHeight(SrcPicture) - 1 'run a loop through the picture to change every pixel For x = 0 To TempWidth For y = 0 To TempHeight iArray(2, x, y) = bTable(iArray(2, x, y)) iArray(1, x, y) = bTable(iArray(1, x, y)) iArray(0, x, y) = bTable(iArray(0, x, y)) Next y 'refresh the picture box every 25 lines (a nice progress bar effect) If x Mod 25 = 0 Then fDraw.SetImageData DstPicture, fDraw.GetImageWidth(SrcPicture), fDraw.GetImageHeight(SrcPicture), iArray() Next x 'final picture refresh fDraw.SetImageData DstPicture, fDraw.GetImageWidth(SrcPicture), fDraw.GetImageHeight(SrcPicture), iArray() 'free up the memory we borrowed for our image array Erase iArray End Sub 'Subroutine for altering an image's brightness as fast as is possible in VB (using data streams) Public Sub DrawFastBrightness(DstPicture As PictureBox, SrcPicture As PictureBox, ByVal Brightness As Long) Dim NewColor As Long Dim x As Long 'Image data Dim iArray() As Byte Dim bTable(0 To 255) As Long 'Build a look-up table of all 256 possible brightness values For x = 0 To 255 NewColor = x + Brightness ByteMe NewColor bTable(x) = NewColor Next x 'Instantiate a FastDrawing class Dim fDraw As New FastDrawing 'Get the image data (in stream format) fDraw.GetImageDataStream SrcPicture, iArray() 'Get the stream length from the image Dim StreamLength As Long StreamLength = fDraw.GetImageStreamLength(SrcPicture) 'run a loop through the picture to change every pixel For x = 0 To StreamLength iArray(x) = bTable(iArray(x)) Next x 'Draw the picture fDraw.SetImageDataStream DstPicture, fDraw.GetImageWidth(SrcPicture), fDraw.GetImageHeight(SrcPicture), iArray() 'free up the memory we borrowed for our image array Erase iArray End Sub 'Standard sub for converting to absolute byte values Public Sub ByteMe(ByRef TempVar As Long) If TempVar > 255 Then TempVar = 255: Exit Sub If TempVar < 0 Then TempVar = 0: Exit Sub End Sub Private Sub Form_Load() Picture2.Picture = Picture1.Picture End Sub Private Sub hScrollBrightness_Change() 'Get the brightness value and send it to the sub tBrightness = CLng(hScrollBrightness.Value) If ChkMethod.Value = vbChecked Then DrawFastBrightness Picture2, Picture1, tBrightness Else DrawBrightness Picture2, Picture1, tBrightness End If End Sub Private Sub hScrollBrightness_Scroll() 'Get the brightness value and send it to the subroutine tBrightness = CLng(hScrollBrightness.Value) If ChkMethod.Value = vbChecked Then DrawFastBrightness Picture2, Picture1, tBrightness Else DrawBrightness Picture2, Picture1, tBrightness End If End Sub ======================= File: Colorize-effect/Colorize.frm ======================= <gh_stars>10-100 VERSION 5.00 Begin VB.Form frmColorize BackColor = &H80000005& BorderStyle = 1 'Fixed Single Caption = "Colorize Image Filter - <EMAIL>" ClientHeight = 9195 ClientLeft = 45 ClientTop = 630 ClientWidth = 11190 BeginProperty Font Name = "Arial" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 613 ScaleMode = 3 'Pixel ScaleWidth = 746 StartUpPosition = 2 'CenterScreen Begin VB.HScrollBar hScrollSaturation Height = 255 Left = 6000 Max = 100 TabIndex = 9 Top = 1200 Value = 50 Width = 2175 End Begin VB.OptionButton optKeepSaturation Appearance = 0 'Flat BackColor = &H80000005& Caption = "Keep original pixel saturation" BeginProperty Font Name = "Tahoma" Size = 9.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 255 Left = 120 TabIndex = 6 Top = 1200 Value = -1 'True Width = 2895 End Begin VB.HScrollBar hScrollHue Height = 255 Left = 720 Max = 359 TabIndex = 5 Top = 240 Value = 180 Width = 7455 End Begin VB.PictureBox picHueDemo Appearance = 0 'Flat AutoRedraw = -1 'True BackColor = &H80000005& ForeColor = &H80000008& Height = 375 Left = 960 ScaleHeight = 23 ScaleMode = 3 'Pixel ScaleWidth = 464 TabIndex = 3 Top = 600 Width = 6990 End Begin VB.CommandButton cmdReset Appearance = 0 'Flat Caption = "Show the Original Image" BeginProperty Font Name = "Tahoma" Size = 9.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 1215 Left = 8400 TabIndex = 2 Top = 240 Width = 2535 End Begin VB.PictureBox picMain Appearance = 0 'Flat AutoRedraw = -1 'True AutoSize = -1 'True BackColor = &H80000005& BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 735 Left = 120 ScaleHeight = 47 ScaleMode = 3 'Pixel ScaleWidth = 87 TabIndex = 0 Top = 1680 Width = 1335 End Begin VB.PictureBox picBack Appearance = 0 'Flat AutoRedraw = -1 'True AutoSize = -1 'True BackColor = &H80000005& BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 6780 Left = 120 ScaleHeight = 450 ScaleMode = 3 'Pixel ScaleWidth = 720 TabIndex = 1 Top = 1680 Visible = 0 'False Width = 10830 End Begin VB.OptionButton optForceSaturation Appearance = 0 'Flat BackColor = &H80000005& Caption = "Force all saturation to" BeginProperty Font Name = "Tahoma" Size = 9.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 255 Left = 3120 TabIndex = 7 Top = 1200 Width = 2175 End Begin VB.Label lblSaturation Appearance = 0 'Flat BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "50%" BeginProperty Font Name = "Tahoma" Size = 9.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 255 Left = 5340 TabIndex = 8 Top = 1200 Width = 615 End Begin VB.Label Label2 BackStyle = 0 'Transparent Caption = "Hue:" BeginProperty Font Name = "Tahoma" Size = 9 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 255 Left = 120 TabIndex = 4 Top = 240 Width = 735 End Begin VB.Menu mnuFile Caption = "&File" Begin VB.Menu mnuOpenImage Caption = "&Open image" End End End Attribute VB_Name = "frmColorize" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False '*************************************************************************** 'Copyright 2018 by <NAME> ' www.tannerhelland.com ' 'Documentation for this project can be found at https://tannerhelland.com/code/ ' 'The source code in this project is licensed under a Simplified BSD license. ' For more information, please review LICENSE.md at https://github.com/tannerhelland/thdc-code/ ' 'If you find this code useful, please consider a small donation to https://www.paypal.me/TannerHelland ' '*************************************************************************** Option Explicit 'When the program is first loaded, several things needs to happen... Private Sub Form_Load() 'Draw a "rainbow" into the hue box to help the user colorize the image properly Dim hVal As Single Dim r As Long, g As Long, b As Long Dim x As Long, y As Long For x = 0 To picHueDemo.ScaleWidth 'Based on our x-position, interpolate an x value between -1 and 5 hVal = x / picHueDemo.ScaleWidth hVal = hVal * 360 hVal = (hVal - 60) / 60 'Use our x-coordinate to generate a hue for this position tHSLToRGB hVal, 1, 0.5, r, g, b 'Draw the color to the box picHueDemo.Line (x, 0)-(x, picHueDemo.ScaleHeight), RGB(r, g, b) Next x picHueDemo.Picture = picHueDemo.Image 'Draw the initial effect with a default value, then update the image If (App.LogMode = 0) Then Me.Caption = Me.Caption & " - compile for significantly better performance!" LoadImageAutosized App.Path & "\sample.jpg" UpdateEffect Me.Show End Sub 'Apply a Colorize filter to an image using a user-specified hue (defined between -1 and 5) and, optionally, a user-specified saturation (defined between 0.0 and 1.0) Public Sub DrawColorize(srcPic As PictureBox, dstPic As PictureBox, ByVal newHue As Single, Optional ByVal forceSaturation As Boolean = False, Optional ByVal newSaturation As Single = 0.5) 'This array will hold the image's pixel data Dim ImageData() As Byte 'Coordinate variables Dim x As Long, y As Long 'Image dimensions Dim iWidth As Long, iHeight As Long 'Instantiate a FastDrawing class and gather the image's data (into ImageData()) Dim fDraw As New FastDrawing iWidth = fDraw.GetImageWidth(srcPic) iHeight = fDraw.GetImageHeight(srcPic) fDraw.GetImageData2D srcPic, ImageData() 'These variables will hold temporary pixel color values (red, green, blue / hue, saturation, luminance) Dim r As Long, g As Long, b As Long Dim HH As Single, SS As Single, LL As Single 'Let's do simple checking to make sure the hue and saturation values we were passed are valid If newHue < -1 Then newHue = -1 If newHue > 5 Then newHue = 5 If newSaturation < 0 Then newSaturation = 0 If newSaturation > 1 Then newSaturation = 1 'Loop through the image, adjusting pixel values as we go Dim xStride As Long For y = 0 To iHeight - 1 For x = 0 To iWidth - 1 xStride = x * 3 b = ImageData(xStride, y) g = ImageData(xStride + 1, y) r = ImageData(xStride + 2, y) 'Get the hue and saturation of the current pixel tRGBToHSL r, g, b, HH, SS, LL 'Convert back to RGB using the hue specified by the user (our artificial saturation value?) If forceSaturation Then tHSLToRGB newHue, newSaturation, LL, r, g, b 'Use this line to force pixel saturation values to 50% Else tHSLToRGB newHue, SS, LL, r, g, b 'Use this line to keep original pixel saturation values End If 'Assign our new colors back into the image array ImageData(xStride, y) = CByte(b) ImageData(xStride + 1, y) = CByte(g) ImageData(xStride + 2, y) = CByte(r) Next x Next y 'Draw the new image data to the screen fDraw.SetImageData2D dstPic, iWidth, iHeight, ImageData() End Sub 'Whenever the scroll bar is moved, redraw the colorized image Private Sub hScrollHue_Change() UpdateEffect End Sub Private Sub hScrollHue_Scroll() UpdateEffect End Sub 'Reset the foreground image to look like the original image Private Sub cmdReset_Click() LoadImageAutosized vbNullString End Sub 'When this scroll bar is changed, make the associated label match its value Private Sub hScrollSaturation_Change() optForceSaturation.Value = True lblSaturation.Caption = hScrollSaturation.Value & "%" UpdateEffect End Sub Private Sub hScrollSaturation_Scroll() optForceSaturation.Value = True lblSaturation.Caption = hScrollSaturation.Value & "%" UpdateEffect End Sub Private Sub MnuOpenImage_Click() 'Windows common dialog interface Dim cDialog As pdOpenSaveDialog Set cDialog = New pdOpenSaveDialog 'VB6's built-in image loader (which wraps an ancient OLE loader) only supports a 'subset of modern image file types. Dim cdfStr As String cdfStr = "All Compatible Graphics|*.bmp;*.jpg;*.jpeg;*.gif;*.wmf;*.emf|" cdfStr = cdfStr & "BMP - Windows Bitmap|*.bmp|EMF - Enhanced Metafile|*.emf|GIF - Compuserve|*.gif|JPG/JPEG - JFIF Compliant|*.jpg;*.jpeg|WMF - Windows Meta File|*.wmf|All files|*.*" Dim sFile As String If cDialog.GetOpenFileName(sFile,, True, False, cdfStr,,, "Select image",, Me.hWnd) Then 'Load the image and refresh the effect LoadImageAutosized sFile UpdateEffect End If End Sub 'If a null string is passed, simply paint an unmodified copy of the backbuffer into the foreground buffer Private Sub LoadImageAutosized(Optional ByVal srcFilePath As String = vbNullString) If (LenB(srcFilePath) <> 0) Then picBack.Picture = LoadPicture(srcFilePath) 'Copy the image, automatically resized, from the background picture box to the foreground one Dim fDraw As FastDrawing Set fDraw = New FastDrawing Dim ImageData() As Byte, imgWidth As Long, imgHeight As Long imgWidth = fDraw.GetImageWidth(Me.picBack) imgHeight = fDraw.GetImageHeight(Me.picBack) fDraw.GetImageData2D Me.picBack, ImageData() Me.picMain.Width = imgWidth + 2 Me.picMain.Height = imgHeight + 2 fDraw.SetImageData2D Me.picMain, imgWidth, imgHeight, ImageData() 'Resize the form to automatically contain the new picture box dimensions. '(This performs some sloppy checks to keep the form from resizing larger than the primary display, ' but it is *not* good code - a proper solution would involve the AdjustWindowRect() API or similar!) Dim newWidth As Long, minWidth As Long minWidth = (cmdReset.Left + cmdReset.Width + 20) * Screen.TwipsPerPixelX If (imgWidth < (Screen.Width \ Screen.TwipsPerPixelX) - 50) Then newWidth = (imgWidth + picMain.Left * 4) * Screen.TwipsPerPixelX If (newWidth < minWidth) Then newWidth = minWidth Me.Width = newWidth End If If (imgHeight < (Screen.Height \ Screen.TwipsPerPixelY) - 50) Then Me.Height = (imgHeight + picMain.Top * 1.5) * Screen.TwipsPerPixelY End Sub Private Sub UpdateEffect() If optForceSaturation.Value Then DrawColorize picBack, picMain, CSng((CSng(hScrollHue.Value) - 60) / 60), True, CSng(CSng(hScrollSaturation.Value) / 100) Else DrawColorize picBack, picMain, CSng((CSng(hScrollHue.Value) - 60) / 60), False End If End Sub 'The next four functions are required to convert between the HSL and RGB colorspaces Public Sub tRGBToHSL(ByVal r As Long, ByVal g As Long, ByVal b As Long, h As Single, s As Single, l As Single) Dim Max As Single, Min As Single, delta As Single Dim rR As Single, rG As Single, rB As Single rR = r / 255 rG = g / 255 rB = b / 255 Max = Maximum(rR, rG, rB) Min = Minimum(rR, rG, rB) l = (Max + Min) / 2 If Max = Min Then s = 0 h = 0 Else If l <= 0.5 Then s = (Max - Min) / (Max + Min) Else s = (Max - Min) / (2 - Max - Min) End If delta = Max - Min If rR = Max Then h = (rG - rB) / delta ElseIf rG = Max Then h = 2 + (rB - rR) / delta ElseIf rB = Max Then h = 4 + (rR - rG) / delta End If End If End Sub Public Sub tHSLToRGB(ByVal h As Single, ByVal s As Single, ByVal l As Single, r As Long, g As Long, b As Long) Dim rR As Single, rG As Single, rB As Single Dim Min As Single, Max As Single If s = 0 Then rR = l rG = l rB = l Else If l <= 0.5 Then Min = l * (1 - s) Else Min = l - s * (1 - l) Max = 2 * l - Min If (h < 1) Then rR = Max If (h < 0) Then rG = Min rB = rG - h * (Max - Min) Else rB = Min rG = h * (Max - Min) + rB End If ElseIf (h < 3) Then rG = Max If (h < 2) Then rB = Min rR = rB - (h - 2) * (Max - Min) Else rR = Min rB = (h - 2) * (Max - Min) + rR End If Else rB = Max If (h < 4) Then rR = Min rG = rR - (h - 4) * (Max - Min) Else rG = Min rR = (h - 4) * (Max - Min) + rG End If End If End If r = rR * 255 g = rG * 255 b = rB * 255 End Sub 'Return the maximum of three variables Private Function Maximum(rR As Single, rG As Single, rB As Single) As Single If (rR > rG) Then If (rR > rB) Then Maximum = rR Else Maximum = rB Else If (rB > rG) Then Maximum = rB Else Maximum = rG End If End Function 'Return the minimum of three variables Private Function Minimum(rR As Single, rG As Single, rB As Single) As Single If (rR < rG) Then If (rR < rB) Then Minimum = rR Else Minimum = rB Else If (rB < rG) Then Minimum = rB Else Minimum = rG End If End Function 'If the user changes the saturation option, redraw the main image to match Private Sub optForceSaturation_Click() UpdateEffect End Sub Private Sub optKeepSaturation_Click() UpdateEffect End Sub ======================= File: Brightness-effect/Part 2 - API - GetPixel and SetPixel/Brightness2.frm ======================= VERSION 5.00 Begin VB.Form frmBrightness AutoRedraw = -1 'True BackColor = &H00C0C0C0& Caption = "Brightness Example - GetPixel/SetPixel - www.tannerhelland.com" ClientHeight = 5655 ClientLeft = 60 ClientTop = 345 ClientWidth = 6285 BeginProperty Font Name = "Arial" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty LinkTopic = "Form1" ScaleHeight = 377 ScaleMode = 3 'Pixel ScaleWidth = 419 StartUpPosition = 2 'CenterScreen Begin VB.CheckBox ChkAutoRedraw Appearance = 0 'Flat BackColor = &H00C0C0C0& Caption = "AutoRedraw" ForeColor = &H80000008& Height = 210 Left = 3120 TabIndex = 4 Top = 5280 Value = 1 'Checked Width = 2295 End Begin VB.TextBox TxtBrightness Appearance = 0 'Flat Height = 285 Left = 4920 TabIndex = 2 Text = "150" Top = 4920 Width = 495 End Begin VB.CommandButton CmdBrightness Caption = "Change Brightness" Height = 615 Left = 120 TabIndex = 1 Top = 4920 Width = 2895 End Begin VB.PictureBox Picture1 Appearance = 0 'Flat AutoRedraw = -1 'True AutoSize = -1 'True BackColor = &H80000005& ForeColor = &H80000008& Height = 4530 Left = 120 Picture = "Brightness2.frx":0000 ScaleHeight = 300 ScaleMode = 3 'Pixel ScaleWidth
69,063
thestackv1_concat_by_repo-long/65536-65536
Repo: brunotarghetta/RandomDataGenerator ======================= File: src/RandomDataGenerator.Gui/UserControlsFields/UserControlTextRegex.cs ======================= using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Gui.UserControls; namespace RandomDataGenerator.Gui.UserControlsFields { public sealed partial class UserControlTextRegex : UserControlTextRegexDesignable { public UserControlTextRegex() { InitializeComponent(); InitEventsForControls(); } public override void SetOptionsAndUpdateControls(FieldOptionsTextRegex options) { base.SetOptionsAndUpdateControls(options); txtPattern.Text = FieldOptions.Pattern?? "[a-z]{1}"; } public override FieldOptionsTextRegex GetFieldOptionsT() { FieldOptions = base.GetFieldOptionsT(); FieldOptions.Pattern = txtPattern.Text; return FieldOptions; } } // Workaround http://stackoverflow.com/questions/677609/generic-base-class-for-winform-usercontrol public class UserControlTextRegexDesignable : BaseUserControl<FieldOptionsTextRegex> { } } ======================= File: src/RandomDataGenerator/Randomizers/RandomizerMACAddress.cs ======================= <filename>src/RandomDataGenerator/Randomizers/RandomizerMACAddress.cs using System.Globalization; using System.Linq; using RandomDataGenerator.Extensions; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Generators; namespace RandomDataGenerator.Randomizers { public class RandomizerMACAddress : RandomizerAbstract<FieldOptionsMACAddress>, IRandomizerString { private readonly byte[] _defaultMin = new byte[] { 0, 0, 0, 0, 0, 0 }; private readonly byte[] _defaultMax = new byte[] { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; private readonly RandomThingsGenerator<byte>[] _octets = new RandomThingsGenerator<byte>[6]; public RandomizerMACAddress(FieldOptionsMACAddress options) : base(options) { byte[] octetsMin = string.IsNullOrEmpty(Options.Min)? _defaultMin : Options.Min.Split(Options.Separator.First()).Select(x => byte.Parse(x, NumberStyles.HexNumber)).ToArray(); byte[] octetsMax = string.IsNullOrEmpty(Options.Max)? _defaultMax : Options.Max.Split(Options.Separator.First()).Select(x => byte.Parse(x, NumberStyles.HexNumber)).ToArray(); for (int i = 0; i < 6; i++) { _octets[i] = new RandomThingsGenerator<byte>(octetsMin[i], octetsMax[i], options.Seed); } } public string Generate() { return IsNull()? null : GenerateInternal(); } private string GenerateInternal() { string value = string.Join(Options.Separator, _octets.Select(gen => $"{gen.Generate():X2}").ToArray()); return value.ToCasedInvariant(Options.Uppercase); } public string Generate(bool upperCase) { return Generate().ToCasedInvariant(upperCase); } } } ======================= File: src/RandomDataGenerator/FieldOptions/FieldOptionsInteger.cs ======================= <gh_stars>10-100  namespace RandomDataGenerator.FieldOptions { public class FieldOptionsInteger : FieldOptionsNumber<int> { public override int Min { get; set; } public override int Max { get; set; } = int.MaxValue; } } ======================= File: src/RandomDataGenerator/FieldOptions/FieldOptionsLastName.cs ======================= <reponame>brunotarghetta/RandomDataGenerator  namespace RandomDataGenerator.FieldOptions { public class FieldOptionsLastName : FieldOptionsAbstract, IFieldOptionsString { } } ======================= File: src/RandomDataGenerator/FieldOptions/FieldOptionsStringList.cs ======================= using System.Collections.Generic; namespace RandomDataGenerator.FieldOptions { public class FieldOptionsStringList : FieldOptionsAbstract, IFieldOptionsString { public List<string> Values { get; set; } } } ======================= File: src/RandomDataGenerator.Gui/Entities/DataField.cs ======================= <reponame>brunotarghetta/RandomDataGenerator using System.ComponentModel; using System.Globalization; using System.Xml.Serialization; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Randomizers; namespace RandomDataGenerator.Gui.Entities { public sealed class DataField : IDataField, IListItem, INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; public DataField() : this(string.Empty, null, null, null) { } public DataField(string name, FieldOptionsAbstract fieldOptions, Field field, SubField subField) { _name = name; _field = field; _subField = subField; _fieldOptions = fieldOptions?.Clone(); Id = GetHashCode().ToString(CultureInfo.InvariantCulture); } public dynamic Generate() { dynamic randomizer = RandomizerFactory.GetRandomizerAsDynamic(FieldOptions); if (randomizer.GetType().GetMethod("GenerateAsString")!= null) { return randomizer.GenerateAsString(); } return randomizer.Generate(); } [XmlIgnore] public string Id { get; } private string _name; public string Name { get => _name; set { if (value!= _name) { _name = value; NotifyPropertyChanged("Name"); } } } private FieldOptionsAbstract _fieldOptions; public FieldOptionsAbstract FieldOptions { get => _fieldOptions; set { if (value!= _fieldOptions) { _fieldOptions = value; NotifyPropertyChanged("FieldOptions"); } } } private Field _field; public Field Field { get => _field; set { if (value!= _field) { _field = value; NotifyPropertyChanged("Field"); } } } private SubField _subField; public SubField SubField { get => _subField; set { if (value!= _subField) { _subField = value; NotifyPropertyChanged("SubField"); } } } // NotifyPropertyChanged will raise the PropertyChanged event passing the source property that is being updated. private void NotifyPropertyChanged(string propertyName) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } } } ======================= File: src/RandomDataGenerator.Gui/MainForm.Fields.ListBox.cs ======================= using System; using System.ComponentModel; using System.Linq; using System.Windows.Forms; using RandomDataGenerator.Enums; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Gui.Entities; using RandomDataGenerator.Gui.Extensions; using RandomDataGenerator.Gui.Properties; using RandomDataGenerator.Gui.UserControls; namespace RandomDataGenerator.Gui { public partial class MainForm { void DataFields_ListChanged(object sender, ListChangedEventArgs e) { var dataFields = (BindingList<DataField>)sender; if (e.ListChangedType == ListChangedType.ItemAdded) { } ListHasItems = dataFields.Count > 0; } private void btnSaveField_Click(object sender, EventArgs e) { var userControl = panelFieldOptions.FindControl<IUserControl>(); if (userControl!= null) { var field = (Field)cmbFields.SelectedItem; var subField = (SubField)cmbSubFields.SelectedItem; int index = _dataFields.FindIndex(f => f.Id == lblHiddenId.Text); var dataField = new DataField(txtFieldName.Text, userControl.GetFieldOptions(), field, subField); if (index < 0) { lblHiddenId.Text = dataField.Id; _dataFields.Add(dataField); } else { /* _dataFields[index].Field = field; _dataFields[index].SubField = subField; _dataFields[index].FieldOptions = userControl.GetFieldOptions(); _dataFields[index].Name = txtFieldName.Text; */ listBoxFields.SelectedIndexChanged -= listBoxFields_SelectedIndexChanged; _dataFields.RemoveAt(index); _dataFields.Insert(index, dataField); listBoxFields.SelectedIndexChanged += listBoxFields_SelectedIndexChanged; listBoxFields.SelectedIndex = index; } } } private void listBoxFields_SelectedIndexChanged(object sender, EventArgs e) { var listBox = (ListBox)sender; var selectedDataField = (DataField)listBox.SelectedItem; IsDataFieldSelected = selectedDataField!= null; if (selectedDataField!= null) { // Update Hidden Id lblHiddenId.Text = selectedDataField.Id; // Update name txtFieldName.Text = selectedDataField.Name; // Update ComboBoxes cmbFields.SelectedItem = selectedDataField.Field; cmbSubFields.SelectedItem = selectedDataField.SubField; // Update FieldOptions var baseUserControl = panelFieldOptions.FindControl<BaseUserControl>(); if (baseUserControl!= null) { baseUserControl.UpdateControls(selectedDataField.FieldOptions); } IsMoveUpFieldEnabled = listBoxFields.SelectedIndex > 0; IsMoveDownFieldEnabled = listBoxFields.SelectedIndex < listBoxFields.Items.Count - 1; } } private void btnAddField_Click(object sender, EventArgs e) { var field = _fieldManager.GetFields().Single(f => f.FieldType == FieldType.Numbers); var dataField = new DataField("New Field", new FieldOptionsInteger(), field, field.SubFields.SingleOrDefault(s => s.SubFieldType == SubFieldType.Integer)); lblHiddenId.Text = dataField.Id; _dataFields.Add(dataField); listBoxFields.SelectedIndex = -1; toolStripStatusLabel1.Text = Resources.NewFieldAdded; } private void btnDeleteField_Click(object sender, EventArgs e) { var dataField = (DataField)listBoxFields.SelectedItem; var result = MessageBox.Show($"Do you want to remove the field [{dataField.Name}]?", Resources.RemoveField, MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { _dataFields.Remove(dataField); ListHasItems = listBoxFields.Items.Count > 0; } } private void btnUp_Click(object sender, EventArgs e) { MoveItem(listBoxFields, -1); } private void btnDown_Click(object sender, EventArgs e) { MoveItem(listBoxFields, 1); } private void MoveItem(ListBox listBox, int direction) { // Checking selected item if (listBox.SelectedItem == null || listBox.SelectedIndex < 0) { // No selected item - nothing to do return; } // Calculate new index using move direction int newIndex = listBox.SelectedIndex + direction; // Checking bounds of the range if (newIndex < 0 || newIndex >= listBox.Items.Count) { // Index out of range - nothing to do return; } var selectedDataField = (DataField)listBox.SelectedItem; // Removing removable element _dataFields.Remove(selectedDataField); // Insert it in new position _dataFields.Insert(newIndex, selectedDataField); // Restore selection listBox.SetSelected(newIndex, true); } private bool _listHasItems; public bool ListHasItems { get => _listHasItems; set { if (value!= _listHasItems) { _listHasItems = value; NotifyPropertyChanged("ListHasItems"); } } } private bool _isMoveUpFieldEnabled; public bool IsMoveUpFieldEnabled { get => _isMoveUpFieldEnabled; set { if (value!= _isMoveUpFieldEnabled) { _isMoveUpFieldEnabled = value; NotifyPropertyChanged("IsMoveUpFieldEnabled"); } } } private bool _isMoveDownFieldEnabled; public bool IsMoveDownFieldEnabled { get => _isMoveDownFieldEnabled; set { if (value!= _isMoveDownFieldEnabled) { _isMoveDownFieldEnabled = value; NotifyPropertyChanged("IsMoveDownFieldEnabled"); } } } private bool _isDataFieldSelected; public bool IsDataFieldSelected { get => _isDataFieldSelected; set { if (value!= _isDataFieldSelected) { _isDataFieldSelected = value; NotifyPropertyChanged("IsDataFieldSelected"); } } } } } ======================= File: src/RandomDataGenerator/Randomizers/RandomizerText.cs ======================= <filename>src/RandomDataGenerator/Randomizers/RandomizerText.cs using RandomDataGenerator.Extensions; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Generators; namespace RandomDataGenerator.Randomizers { public class RandomizerText : RandomizerAbstract<FieldOptionsText>, IRandomizerString { private readonly RandomStringGenerator _generator; public RandomizerText(FieldOptionsText options) : base(options) { _generator = new RandomStringGenerator(options.Seed, options.UseUppercase, options.UseLowercase, options.UseNumber, options.UseSpecial, options.UseSpace); } public string Generate() { return IsNull()? null : _generator.Generate(Options.Min, Options.Max); } public string Generate(bool upperCase) { return Generate().ToCasedInvariant(upperCase); } } } ======================= File: src/RandomDataGenerator/Randomizers/RandomizerFullName.cs ======================= <reponame>brunotarghetta/RandomDataGenerator<filename>src/RandomDataGenerator/Randomizers/RandomizerFullName.cs using System.Collections.Generic; using RandomDataGenerator.Data; using RandomDataGenerator.Extensions; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Generators; namespace RandomDataGenerator.Randomizers { public class RandomizerFullName : RandomizerAbstract<FieldOptionsFullName>, IRandomizerString { private readonly RandomThingsGenerator<int> _numberGenerator; private readonly RandomStringFromListGenerator _lastNamesGenerator; private readonly List<RandomStringFromListGenerator> _genderSetGenerators = new List<RandomStringFromListGenerator>(); public RandomizerFullName(FieldOptionsFullName options) : base(options) { _lastNamesGenerator = new RandomStringFromListGenerator(ListData.Instance.LastNames); if (options.Male) { _genderSetGenerators.Add(new RandomStringFromListGenerator(ListData.Instance.MaleNames)); } if (options.Female) { _genderSetGenerators.Add(new RandomStringFromListGenerator(ListData.Instance.FemaleNames)); } _numberGenerator = new RandomThingsGenerator<int>(0, _genderSetGenerators.Count, options.Seed); } public string Generate() { if (IsNull()) { return null; } int maleOrFemale = _numberGenerator.Generate(); var firstNamesSet = _genderSetGenerators[maleOrFemale]; string firstName = firstNamesSet.Generate(); string lastname = _lastNamesGenerator.Generate(); return $"{firstName} {lastname}"; } public string Generate(bool upperCase) { return Generate().ToCasedInvariant(upperCase); } } } ======================= File: src/RandomDataGenerator.Gui/UserControls/UserControlExample.Designer.cs ======================= namespace RandomDataGenerator.Gui.UserControls { partial class UserControlExample { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components!= null)) { components.Dispose(); } base.Dispose(disposing); } #region Component Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.lblExample = new System.Windows.Forms.Label(); this.txtExample = new System.Windows.Forms.TextBox(); this.btnRefresh = new System.Windows.Forms.Button(); this.SuspendLayout(); // // lblExample // this.lblExample.AutoSize = true; this.lblExample.Location = new System.Drawing.Point(4, 7); this.lblExample.Name = "lblExample"; this.lblExample.Size = new System.Drawing.Size(47, 13); this.lblExample.TabIndex = 0; this.lblExample.Text = "Example"; // // txtExample // this.txtExample.BackColor = System.Drawing.SystemColors.ButtonHighlight; this.txtExample.Location = new System.Drawing.Point(53, 4); this.txtExample.Name = "txtExample"; this.txtExample.ReadOnly = true; this.txtExample.Size = new System.Drawing.Size(310, 20); this.txtExample.TabIndex = 1; // // btnRefresh // this.btnRefresh.FlatAppearance.BorderSize = 0; this.btnRefresh.Image = global::RandomDataGenerator.Gui.Properties.Resources.arrow_refresh_small; this.btnRefresh.Location = new System.Drawing.Point(365, 4); this.btnRefresh.Name = "btnRefresh"; this.btnRefresh.Size = new System.Drawing.Size(21, 21); this.btnRefresh.TabIndex = 2; this.btnRefresh.UseVisualStyleBackColor = true; // // UserControlExample // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.btnRefresh); this.Controls.Add(this.txtExample); this.Controls.Add(this.lblExample); this.Name = "UserControlExample"; this.Size = new System.Drawing.Size(390, 30); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.Label lblExample; public System.Windows.Forms.TextBox txtExample; public System.Windows.Forms.Button btnRefresh; } } ======================= File: src/RandomDataGenerator.Gui/UserControls/UserControlOutputSQL.cs ======================= <filename>src/RandomDataGenerator.Gui/UserControls/UserControlOutputSQL.cs using RandomDataGenerator.Gui.Generation; namespace RandomDataGenerator.Gui.UserControls { public partial class UserControlOutputSQL : UserControlOutputSQLDesignable { public UserControlOutputSQL() { } public UserControlOutputSQL(GenerateOptionsSQL options) : base(options) { InitializeComponent(); } public override void UpdateControls(GenerateOptionsSQL options) { base.UpdateControls(options); numRecordsPerInsert.Value = options.RecordsPerInsert; chkIncludeFieldNames.Checked = options.IncludeFieldNames; txtTableName.Text = options.Table; } public override GenerateOptionsSQL GetGenerateOptions() { GenerateOptions.IncludeFieldNames = chkIncludeFieldNames.Checked; GenerateOptions.RecordsPerInsert = (int) numRecordsPerInsert.Value; GenerateOptions.Table = txtTableName.Text; return GenerateOptions; } } // Workaround http://stackoverflow.com/questions/677609/generic-base-class-for-winform-usercontrol public class UserControlOutputSQLDesignable : BaseUserControlOutput<GenerateOptionsSQL> { public UserControlOutputSQLDesignable() { } public UserControlOutputSQLDesignable(GenerateOptionsSQL options) : base(options) { } } } ======================= File: src/RandomDataGenerator/FieldOptions/FieldOptionsMACAddress.cs ======================= <filename>src/RandomDataGenerator/FieldOptions/FieldOptionsMACAddress.cs namespace RandomDataGenerator.FieldOptions { public class FieldOptionsMACAddress : FieldOptionsAbstract, IFieldOptionsString { public string Separator { get; set; } = ":"; public bool Uppercase { get; set; } = true; public string Min { get; set; } public string Max { get; set; } } } ======================= File: src/RandomDataGenerator/Randomizers/RandomizerTextNaughtyStrings.cs ======================= <reponame>brunotarghetta/RandomDataGenerator<gh_stars>10-100 using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using RandomDataGenerator.Data; using RandomDataGenerator.Extensions; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Generators; namespace RandomDataGenerator.Randomizers { public class RandomizerTextNaughtyStrings : RandomizerAbstract<FieldOptionsTextNaughtyStrings>, IRandomizerString { private readonly RandomStringFromListGenerator _naughtyStringCategoryGenerator; public RandomizerTextNaughtyStrings(FieldOptionsTextNaughtyStrings options) : base(options) { Type type = typeof(TheNaughtyStrings); var allStrings = new List<string>(TheNaughtyStrings.All); var categories = options.Categories .Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries) .Select(s => s.Trim()) .Where(s => s!= FieldOptionsTextNaughtyStrings.All); foreach (string category in categories) { if (type.GetField(category).GetValue(null) is IList<string> strings) { allStrings.AddRange(strings); } } _naughtyStringCategoryGenerator = new RandomStringFromListGenerator(allStrings); } public string Generate() { return IsNull()? null : _naughtyStringCategoryGenerator.Generate(); } public string Generate(bool upperCase) { return Generate().ToCasedInvariant(upperCase); } } } ======================= File: src/RandomDataGenerator/Randomizers/RandomizerAbstract.cs ======================= using System; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Generators; namespace RandomDataGenerator.Randomizers { public abstract class RandomizerAbstract<TOptions> where TOptions : FieldOptionsAbstract { private readonly RandomValueGenerator _randomValueGenerator; protected readonly TOptions Options; protected RandomizerAbstract(TOptions options) { Options = options; _randomValueGenerator = new RandomValueGenerator(Options.Seed?? Environment.TickCount); } protected virtual bool IsNull() { return Options.UseNullValues && _randomValueGenerator.Next(0, 10) == 5; // 10% chance on null } } } ======================= File: src/RandomDataGenerator.Gui/UserControlsFields/UserControlText.Designer.cs ======================= <filename>src/RandomDataGenerator.Gui/UserControlsFields/UserControlText.Designer.cs<gh_stars>10-100 namespace RandomDataGenerator.Gui.UserControlsFields { sealed partial class UserControlText { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components!= null)) { components.Dispose(); } base.Dispose(disposing); } #region Component Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.lblFrom = new System.Windows.Forms.Label(); this.lblTo = new System.Windows.Forms.Label(); this.ctrlMinLength = new System.Windows.Forms.NumericUpDown(); this.ctrlMaxLength = new System.Windows.Forms.NumericUpDown(); this.lblChars = new System.Windows.Forms.Label(); this.boxCharsAllowed = new System.Windows.Forms.GroupBox(); this.rbUpper = new System.Windows.Forms.RadioButton(); this.rbLower = new System.Windows.Forms.RadioButton(); this.rbBoth = new System.Windows.Forms.RadioButton(); this.chkSpecial = new System.Windows.Forms.CheckBox(); this.chkSpace = new System.Windows.Forms.CheckBox(); this.chkNumber = new System.Windows.Forms.CheckBox(); this.chkLetter = new System.Windows.Forms.CheckBox(); ((System.ComponentModel.ISupportInitialize)(this.ctrlMinLength)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.ctrlMaxLength)).BeginInit(); this.boxCharsAllowed.SuspendLayout(); this.SuspendLayout(); // // lblFrom // this.lblFrom.AutoSize = true; this.lblFrom.Location = new System.Drawing.Point(4, 7); this.lblFrom.Name = "lblFrom"; this.lblFrom.Size = new System.Drawing.Size(63, 13); this.lblFrom.TabIndex = 0; this.lblFrom.Text = "Length from"; // // lblTo // this.lblTo.AutoSize = true; this.lblTo.Location = new System.Drawing.Point(118, 8); this.lblTo.Name = "lblTo"; this.lblTo.Size = new System.Drawing.Size(16, 13); this.lblTo.TabIndex = 2; this.lblTo.Text = "to"; // // ctrlMin // this.ctrlMinLength.Location = new System.Drawing.Point(72, 4); this.ctrlMinLength.Maximum = new decimal(new int[] { 99, 0, 0, 0}); this.ctrlMinLength.Name = "ctrlMinLength"; this.ctrlMinLength.Size = new System.Drawing.Size(40, 20); this.ctrlMinLength.TabIndex = 1; this.ctrlMinLength.ValueChanged += new System.EventHandler(this.MinLengthValueChanged); // // ctrlMax // this.ctrlMaxLength.Location = new System.Drawing.Point(140, 5); this.ctrlMaxLength.Name = "ctrlMaxLength"; this.ctrlMaxLength.Size = new System.Drawing.Size(40, 20); this.ctrlMaxLength.TabIndex = 3; this.ctrlMaxLength.Value = new decimal(new int[] { 5, 0, 0, 0}); this.ctrlMaxLength.ValueChanged += new System.EventHandler(this.MaxLengthValueChanged); // // lblChars // this.lblChars.AutoSize = true; this.lblChars.Location = new System.Drawing.Point(186, 9); this.lblChars.Name = "lblChars"; this.lblChars.Size = new System.Drawing.Size(60, 13); this.lblChars.TabIndex = 4; this.lblChars.Text = "characters."; // // boxCharsAllowed // this.boxCharsAllowed.Controls.Add(this.rbUpper); this.boxCharsAllowed.Controls.Add(this.rbLower); this.boxCharsAllowed.Controls.Add(this.rbBoth); this.boxCharsAllowed.Controls.Add(this.chkSpecial); this.boxCharsAllowed.Controls.Add(this.chkSpace); this.boxCharsAllowed.Controls.Add(this.chkNumber); this.boxCharsAllowed.Controls.Add(this.chkLetter); this.boxCharsAllowed.Location = new System.Drawing.Point(7, 43); this.boxCharsAllowed.Name = "boxCharsAllowed"; this.boxCharsAllowed.Size = new System.Drawing.Size(370, 120); this.boxCharsAllowed.TabIndex = 5; this.boxCharsAllowed.TabStop = false; this.boxCharsAllowed.Text = "Characters Allowed"; // // rbUpper // this.rbUpper.AutoSize = true; this.rbUpper.Location = new System.Drawing.Point(276, 18); this.rbUpper.Name = "rbUpper"; this.rbUpper.Size = new System.Drawing.Size(78, 17); this.rbUpper.TabIndex = 6; this.rbUpper.Text = "UpperCase"; this.rbUpper.UseVisualStyleBackColor = true; // // rbLower // this.rbLower.AutoSize = true; this.rbLower.Location = new System.Drawing.Point(182, 18); this.rbLower.Name = "rbLower"; this.rbLower.Size = new System.Drawing.Size(78, 17); this.rbLower.TabIndex = 5; this.rbLower.Text = "LowerCase"; this.rbLower.UseVisualStyleBackColor = true; // // rbBoth // this.rbBoth.AutoSize = true; this.rbBoth.Checked = true; this.rbBoth.Location = new System.Drawing.Point(114, 18); this.rbBoth.Name = "rbBoth"; this.rbBoth.Size = new System.Drawing.Size(47, 17); this.rbBoth.TabIndex = 4; this.rbBoth.TabStop = true; this.rbBoth.Text = "Both"; this.rbBoth.UseVisualStyleBackColor = true; // // chkSpecial // this.chkSpecial.AutoSize = true; this.chkSpecial.Location = new System.Drawing.Point(15, 88); this.chkSpecial.Name = "chkSpecial"; this.chkSpecial.Size = new System.Drawing.Size(61, 17); this.chkSpecial.TabIndex = 3; this.chkSpecial.Text = "Special"; this.chkSpecial.UseVisualStyleBackColor = true; // // chkSpace // this.chkSpace.AutoSize = true; this.chkSpace.Location = new System.Drawing.Point(15, 65); this.chkSpace.Name = "chkSpace"; this.chkSpace.Size = new System.Drawing.Size(57, 17); this.chkSpace.TabIndex = 2; this.chkSpace.Text = "Space"; this.chkSpace.UseVisualStyleBackColor = true; // // chkNumber // this.chkNumber.AutoSize = true; this.chkNumber.Location = new System.Drawing.Point(15, 42); this.chkNumber.Name = "chkNumber"; this.chkNumber.Size = new System.Drawing.Size(63, 17); this.chkNumber.TabIndex = 1; this.chkNumber.Text = "Number"; this.chkNumber.UseVisualStyleBackColor = true; // // chkLetter // this.chkLetter.AutoSize = true; this.chkLetter.Location = new System.Drawing.Point(15, 19); this.chkLetter.Name = "chkLetter"; this.chkLetter.Size = new System.Drawing.Size(53, 17); this.chkLetter.TabIndex = 0; this.chkLetter.Text = "Letter"; this.chkLetter.UseVisualStyleBackColor = true; // // UserControlTextRandomLength // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.boxCharsAllowed); this.Controls.Add(this.lblChars); this.Controls.Add(this.ctrlMaxLength); this.Controls.Add(this.ctrlMinLength); this.Controls.Add(this.lblTo); this.Controls.Add(this.lblFrom); this.Name = "UserControlTextRandomLength"; this.Size = new System.Drawing.Size(390, 190); ((System.ComponentModel.ISupportInitialize)(this.ctrlMinLength)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.ctrlMaxLength)).EndInit(); this.boxCharsAllowed.ResumeLayout(false); this.boxCharsAllowed.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.Label lblFrom; private System.Windows.Forms.Label lblTo; private System.Windows.Forms.NumericUpDown ctrlMinLength; private System.Windows.Forms.NumericUpDown ctrlMaxLength; private System.Windows.Forms.Label lblChars; private System.Windows.Forms.GroupBox boxCharsAllowed; private System.Windows.Forms.CheckBox chkSpecial; private System.Windows.Forms.CheckBox chkSpace; private System.Windows.Forms.CheckBox chkNumber; private System.Windows.Forms.CheckBox chkLetter; private System.Windows.Forms.RadioButton rbUpper; private System.Windows.Forms.RadioButton rbLower; private System.Windows.Forms.RadioButton rbBoth; } } ======================= File: src/RandomDataGenerator/FieldOptions/FieldOptionsAbstract.cs ======================= <reponame>brunotarghetta/RandomDataGenerator #if!NETSTANDARD1_3 using System.Xml.Serialization; #endif namespace RandomDataGenerator.FieldOptions { #if!NETSTANDARD1_3 [XmlInclude(typeof(FieldOptionsBytes))] [XmlInclude(typeof(FieldOptionsCity))] [XmlInclude(typeof(FieldOptionsCountry))] [XmlInclude(typeof(FieldOptionsDateTime))] [XmlInclude(typeof(FieldOptionsEmailAddress))] [XmlInclude(typeof(FieldOptionsFirstName))] [XmlInclude(typeof(FieldOptionsIBAN))] [XmlInclude(typeof(FieldOptionsNumber<byte>))] [XmlInclude(typeof(FieldOptionsNumber<short>))] [XmlInclude(typeof(FieldOptionsNumber<int>))] [XmlInclude(typeof(FieldOptionsNumber<long>))] [XmlInclude(typeof(FieldOptionsNumber<float>))] [XmlInclude(typeof(FieldOptionsNumber<double>))] [XmlInclude(typeof(FieldOptionsFullName))] [XmlInclude(typeof(FieldOptionsGuid))] [XmlInclude(typeof(FieldOptionsInteger))] [XmlInclude(typeof(FieldOptionsIPv4Address))] [XmlInclude(typeof(FieldOptionsIPv6Address))] [XmlInclude(typeof(FieldOptionsLastName))] [XmlInclude(typeof(FieldOptionsMACAddress))] [XmlInclude(typeof(FieldOptionsTextPattern))] [XmlInclude(typeof(FieldOptionsTextRegex))] [XmlInclude(typeof(FieldOptionsTextNaughtyStrings))] [XmlInclude(typeof(FieldOptionsText))] [XmlInclude(typeof(FieldOptionsTextWords))] [XmlInclude(typeof(FieldOptionsStringList))] #endif public abstract class FieldOptionsAbstract { public bool UseNullValues { get; set; } public bool ValueAsString { get; set; } public int? Seed { get; set; } public FieldOptionsAbstract Clone() { return (FieldOptionsAbstract)MemberwiseClone(); } } } ======================= File: src/RandomDataGenerator/FieldOptions/FieldOptionsTextPattern.cs ======================= <reponame>brunotarghetta/RandomDataGenerator using System; namespace RandomDataGenerator.FieldOptions { [Obsolete("Use FieldOptionsTextRegex")] public class FieldOptionsTextPattern : FieldOptionsAbstract, IFieldOptionsString { /// <summary> /// L - for upper case letter /// l - for lower case letter /// n - for number /// s - for special character /// _ - for space character /// * - for any character /// \ - for character as-is /// </summary> public string Pattern { get; set; } } } ======================= File: src/RandomDataGenerator/Data/ListData.cs ======================= using System; using System.Collections.Generic; using System.IO; using System.Reflection; using System.Text; using Fare; using RandomDataGenerator.Data.Models; namespace RandomDataGenerator.Data { internal sealed class ListData { private const char Tab = '\t'; public IEnumerable<string> LastNames { get; } public IEnumerable<string> MaleNames { get; } public IEnumerable<string> FemaleNames { get; } public IEnumerable<string> CityNames { get; } public IEnumerable<string> CountryNames { get; } public IEnumerable<string> Directions { get; } public IEnumerable<string> StreetTypes { get; } public IEnumerable<string> TopLevelDomains { get; } public IEnumerable<IBAN> IBANs { get; } public IEnumerable<IBAN> BBANs { get; } public IEnumerable<string> LoremIpsum { get; } public IEnumerable<string> LoremIpsumWords { get; } private ListData() { LastNames = GetResourceAsLines("LastNames"); MaleNames = GetResourceAsLines("MaleNames"); FemaleNames = GetResourceAsLines("FemaleNames"); CityNames = GetResourceAsLines("CityNames"); CountryNames = GetResourceAsLines("CountryNames"); Directions = new[] { "North", "East", "South", "West" }; StreetTypes = new[] { "St.", "Ln.", "Ave.", "Way", "Blvd.", "Ct." }; TopLevelDomains = new[] { "com", "net", "org", "us", "gov", "nl" }; Func<string[], IBAN> ibanFunc = (columns) => new IBAN { CountryName = columns[0], CountryCode = columns[1], Generator = new Xeger(columns[2]) }; IBANs = GetResourceAsItems("IBAN", ibanFunc); BBANs = GetResourceAsItems("BBAN", ibanFunc); LoremIpsum = GetResourceAsLines("LoremIpsum"); LoremIpsumWords = GetResourceAsLines("LorumIpsumWords"); } public static ListData Instance => Nested.TextInstance; // ReSharper disable once ClassNeverInstantiated.Local private class Nested { // Explicit static constructor to tell C# compiler not to mark type as before field-init static Nested() { } internal static readonly ListData TextInstance = new ListData(); } private static Stream GetResourceAsStream(string resourceName) { return typeof(ListData).GetTypeInfo().Assembly.GetManifestResourceStream($"RandomDataGenerator.Data.Text.{resourceName}.txt"); } private static IEnumerable<string> GetResourceAsLines(string fileName) { using (var stream = GetResourceAsStream(fileName)) { using (var reader = new StreamReader(stream, Encoding.UTF8)) { string line; while ((line = reader.ReadLine())!= null) { yield return line; } } } } private static IEnumerable<T> GetResourceAsItems<T>(string fileName, Func<string[], T> convert) { var lines = GetResourceAsLines(fileName); foreach (var line in lines) { yield return convert(line.Split(Tab)); } } } } ======================= File: src/RandomDataGenerator/Enums/SubFieldType.cs ======================= <gh_stars>10-100 using System.ComponentModel; namespace RandomDataGenerator.Enums { public enum SubFieldType { None, // Numbers [Description("Boolean")] Boolean, [Description("Short")] Short, [Description("Integer")] Integer, [Description("Long")] Long, [Description("Float")] Float, [Description("Double")] Double, // IT [Description("IPv4 Address")] IPv4Address, [Description("IPv6 Address")] IPv6Address, [Description("MAC Address")] MACAddress, [Description("Guid")] Guid, // Human [Description("Full Name")] FullName, [Description("Last Name")] LastName, [Description("First Name")] FirstName, [Description("Email Address")] EmailAddress, // Location [Description("Country")] Country, [Description("City")] City, // Text [Description("Words")] TextWords, [Description("Text Pattern")] TextPattern, [Description("Text Regex")] TextRegex, [Description("Text Lipsum")] TextLipsum, [Description("Random Text")] Text, [Description("Naughty Strings")] TextNaughtyStrings, [Description("Date / Time")] DateTime, // Set [Description("String List")] StringList } } ======================= File: src/RandomDataGenerator/Randomizers/IRandomizerBytes.cs ======================= <filename>src/RandomDataGenerator/Randomizers/IRandomizerBytes.cs using System.Text; using JetBrains.Annotations; namespace RandomDataGenerator.Randomizers { public interface IRandomizerBytes { byte[] Generate(); string GenerateAsUTF8String(); string GenerateAsASCIIString(); string GenerateAsBase64String(); string GenerateAsString([CanBeNull] Encoding encoding = null); } } ======================= File: src/RandomDataGenerator/Enums/FieldType.cs ======================= using System.ComponentModel; namespace RandomDataGenerator.Enums { public enum FieldType { None, [Description("Numbers")] Numbers, [Description("IT")] IT, [Description("Human")] Human, [Description("Location")] Location, [Description("Text")] Text, [Description("Time")] Time, [Description("Set")] Set } } ======================= File: src/RandomDataGenerator/Randomizers/RandomizerIPv6Address.cs ======================= <filename>src/RandomDataGenerator/Randomizers/RandomizerIPv6Address.cs<gh_stars>10-100 using System.Globalization; using System.Linq; using RandomDataGenerator.Extensions; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Generators; namespace RandomDataGenerator.Randomizers { public class RandomizerIPv6Address : RandomizerAbstract<FieldOptionsIPv6Address>, IRandomizerString { private readonly int[] defaultMin = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }; private readonly int[] defaultMax = new int[] { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }; private readonly RandomThingsGenerator<int>[] hextets = new RandomThingsGenerator<int>[8]; public RandomizerIPv6Address(FieldOptionsIPv6Address options) : base(options) { int[] hextetsMin = string.IsNullOrEmpty(Options.Min)? defaultMin : Options.Min.Split(':').Select(x => int.Parse(x, NumberStyles.HexNumber)).ToArray(); int[] hextetsMax = string.IsNullOrEmpty(Options.Max)? defaultMax : Options.Max.Split(':').Select(x => int.Parse(x, NumberStyles.HexNumber)).ToArray(); for (int i = 0; i < 8; i++) { hextets[i] = new RandomThingsGenerator<int>(hextetsMin[i], hextetsMax[i], options.Seed); } } public string Generate() { if (IsNull()) { return null; } return string.Join(":", hextets.Select(gen => $"{gen.Generate():X4}").ToArray()); } public string Generate(bool upperCase) { return Generate().ToCasedInvariant(upperCase); } } } ======================= File: src/RandomDataGenerator/Randomizers/RandomizerGuid.cs ======================= using System; using RandomDataGenerator.Extensions; using RandomDataGenerator.FieldOptions; namespace RandomDataGenerator.Randomizers { public class RandomizerGuid : RandomizerAbstract<FieldOptionsGuid>, IRandomizerGuid { public RandomizerGuid(FieldOptionsGuid options) : base(options) { } public Guid? Generate() { if (IsNull()) { return null; } return Guid.NewGuid(); } public string GenerateAsString() { if (IsNull()) { return null; } return Guid.NewGuid().ToString(Options.Format).ToCasedInvariant(Options.Uppercase); } } } ======================= File: src/RandomDataGenerator.Gui/Program.cs ======================= using System; using System.Windows.Forms; namespace RandomDataGenerator.Gui { static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var form = new MainForm { // Text = $"RandomDataGenerator.Gui {VersionInfo.AssemblyVersion}" Text = "RandomDataGenerator.Gui" }; #if NETCOREAPP3_0 // https://github.com/dotnet/winforms/issues/135 Application.SetHighDpiMode(HighDpiMode.PerMonitorV2); #endif Application.Run(form); } } } ======================= File: src/RandomDataGenerator/FieldOptions/FieldOptionsDouble.cs ======================= <gh_stars>10-100  namespace RandomDataGenerator.FieldOptions { public class FieldOptionsDouble : FieldOptionsNumber<double> { public override double Min { get; set; } public override double Max { get; set; } = double.MaxValue; } } ======================= File: src/RandomDataGenerator.Gui/UserControlsFields/UserControlDateTime.Designer.cs ======================= <reponame>brunotarghetta/RandomDataGenerator namespace RandomDataGenerator.Gui.UserControlsFields { sealed partial class UserControlDateTime { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components!= null)) { components.Dispose(); } base.Dispose(disposing); } #region Component Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.datePickerFrom = new System.Windows.Forms.DateTimePicker(); this.boxTo = new System.Windows.Forms.GroupBox(); this.timePickerTo = new System.Windows.Forms.DateTimePicker(); this.datePickerTo = new System.Windows.Forms.DateTimePicker(); this.boxFrom = new System.Windows.Forms.GroupBox(); this.timePickerFrom = new System.Windows.Forms.DateTimePicker(); this.chkIncludeTime = new System.Windows.Forms.CheckBox(); this.lblIncludeTimePart = new System.Windows.Forms.Label(); this.boxTo.SuspendLayout(); this.boxFrom.SuspendLayout(); this.SuspendLayout(); // // datePickerFrom // this.datePickerFrom.Format = System.Windows.Forms.DateTimePickerFormat.Short; this.datePickerFrom.Location = new System.Drawing.Point(20, 20); this.datePickerFrom.Name = "datePickerFrom"; this.datePickerFrom.Size = new System.Drawing.Size(80, 20); this.datePickerFrom.TabIndex = 0; // // boxTo // this.boxTo.Controls.Add(this.timePickerTo); this.boxTo.Controls.Add(this.datePickerTo); this.boxTo.Location = new System.Drawing.Point(198, 3); this.boxTo.Name = "boxTo"; this.boxTo.Size = new System.Drawing.Size(180, 100); this.boxTo.TabIndex = 1; this.boxTo.TabStop = false; this.boxTo.Text = "Date/Time To"; // // timePickerTo // this.timePickerTo.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", this, "IncludeTime", true)); this.timePickerTo.Format = System.Windows.Forms.DateTimePickerFormat.Time; this.timePickerTo.Location = new System.Drawing.Point(21, 60); this.timePickerTo.Name = "timePickerTo"; this.timePickerTo.ShowUpDown = true; this.timePickerTo.Size = new System.Drawing.Size(80, 20); this.timePickerTo.TabIndex = 3; // // datePickerTo // this.datePickerTo.Format = System.Windows.Forms.DateTimePickerFormat.Short; this.datePickerTo.Location = new System.Drawing.Point(21, 20); this.datePickerTo.Name = "datePickerTo"; this.datePickerTo.Size = new System.Drawing.Size(80, 20); this.datePickerTo.TabIndex = 2; // // boxFrom // this.boxFrom.Controls.Add(this.timePickerFrom); this.boxFrom.Controls.Add(this.datePickerFrom); this.boxFrom.Location = new System.Drawing.Point(3, 3); this.boxFrom.Name = "boxFrom"; this.boxFrom.Size = new System.Drawing.Size(180, 100); this.boxFrom.TabIndex = 2; this.boxFrom.TabStop = false; this.boxFrom.Text = "Date/Time From"; // // timePickerFrom // this.timePickerFrom.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", this, "IncludeTime", true)); this.timePickerFrom.Format = System.Windows.Forms.DateTimePickerFormat.Time; this.timePickerFrom.Location = new System.Drawing.Point(20, 60); this.timePickerFrom.Name = "timePickerFrom"; this.timePickerFrom.ShowUpDown = true; this.timePickerFrom.Size = new System.Drawing.Size(80, 20); this.timePickerFrom.TabIndex = 1; // // chkIncludeTime // this.chkIncludeTime.AutoSize = true; this.chkIncludeTime.DataBindings.Add(new System.Windows.Forms.Binding("Checked", this, "IncludeTime", true)); this.chkIncludeTime.Location = new System.Drawing.Point(108, 119); this.chkIncludeTime.Name = "chkIncludeTime"; this.chkIncludeTime.Size = new System.Drawing.Size(15, 14); this.chkIncludeTime.TabIndex = 3; this.chkIncludeTime.UseVisualStyleBackColor = true; this.chkIncludeTime.CheckedChanged += new System.EventHandler(this.CheckedChangedIncludeTime); // // lblIncludeTimePart // this.lblIncludeTimePart.AutoSize = true; this.lblIncludeTimePart.Location = new System.Drawing.Point(4, 119); this.lblIncludeTimePart.Name = "lblIncludeTimePart"; this.lblIncludeTimePart.Size = new System.Drawing.Size(90, 13); this.lblIncludeTimePart.TabIndex = 4; this.lblIncludeTimePart.Text = "Include Time Part"; // // UserControlDateTime // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.lblIncludeTimePart); this.Controls.Add(this.chkIncludeTime); this.Controls.Add(this.boxFrom); this.Controls.Add(this.boxTo); this.Name = "UserControlDateTime"; this.Size = new System.Drawing.Size(390, 160); this.boxTo.ResumeLayout(false); this.boxFrom.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.DateTimePicker datePickerFrom; private System.Windows.Forms.GroupBox boxTo; private System.Windows.Forms.GroupBox boxFrom; private System.Windows.Forms.DateTimePicker timePickerFrom; private System.Windows.Forms.DateTimePicker timePickerTo; private System.Windows.Forms.DateTimePicker datePickerTo; private System.Windows.Forms.CheckBox chkIncludeTime; private System.Windows.Forms.Label lblIncludeTimePart; } } ======================= File: src/RandomDataGenerator/Randomizers/RandomizerNumber.cs ======================= <gh_stars>10-100 using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Generators; namespace RandomDataGenerator.Randomizers { public class RandomizerNumber<T> : RandomizerAbstract<FieldOptionsNumber<T>>, IRandomizerNumber<T> where T : struct { private readonly RandomThingsGenerator<T> _generator; public RandomizerNumber(FieldOptionsNumber<T> options) : base(options) { _generator = new RandomThingsGenerator<T>(options.Min, options.Max, options.Seed); } public T? Generate() { return IsNull()? null : (T?)_generator.Generate(); } } } ======================= File: src/RandomDataGenerator/FieldOptions/FieldOptionsLong.cs =======================  namespace RandomDataGenerator.FieldOptions { public class FieldOptionsLong : FieldOptionsNumber<long> { public override long Min { get; set; } public override long Max { get; set; } = long.MaxValue; } } ======================= File: src/RandomDataGenerator.Gui/Generation/IGenerate.cs ======================= using System.Collections.Generic; using RandomDataGenerator.Gui.Entities; namespace RandomDataGenerator.Gui.Generation { interface IGenerate { void Spawn(List<DataField> fields, int totalRecords, string fileName); } } ======================= File: src/RandomDataGenerator/FieldOptions/FieldOptionsIBAN.cs =======================  namespace RandomDataGenerator.FieldOptions { public class FieldOptionsIBAN : FieldOptionsAbstract, IFieldOptionsString { public string CountryCode { get; set; } /// <summary> /// The type can be IBAN (default), BBAN or BOTH. In case the value is null, IBAN is used as default. /// </summary> public string Type { get; set; } = "IBAN"; } } ======================= File: src/RandomDataGenerator.Gui/UserControls/BaseUserControl.cs ======================= using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Gui.Extensions; using RandomDataGenerator.Gui.UserControlsFields; using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; namespace RandomDataGenerator.Gui.UserControls { public abstract class BaseUserControl : UserControl, IUserControl { public event EventHandler OptionsChanged; protected BaseUserControl() { InitControls(); } public virtual void OnOptionsChanged(EventArgs e) { OptionsChanged?.Invoke(this, e); } protected virtual void HandleOptionsChangedChanged(object sender, EventArgs e) { OnOptionsChanged(EventArgs.Empty); } public virtual void SetOptions(FieldOptionsAbstract options) { throw new NotImplementedException(); } public virtual FieldOptionsAbstract GetFieldOptions() { throw new NotImplementedException(); } public virtual void UpdateControls(FieldOptionsAbstract options) { throw new NotImplementedException(); } private void InitControls() { if (!(this is UserControlCommonOptions)) { var commonControl = this.FindControl<UserControlCommonOptions>(); if (commonControl!= null) { commonControl.OptionsChanged -= OptionsChanged; commonControl.Dispose(); } commonControl = new UserControlCommonOptions { Dock = DockStyle.Bottom, Name = "CommonCtrl", }; commonControl.OptionsChanged += OptionsChanged; Controls.Add(commonControl); } } } public abstract class BaseUserControl<TOptions> : BaseUserControl, IUserControl<TOptions> where TOptions : FieldOptionsAbstract //, new() { protected TOptions FieldOptions; public override void SetOptions(FieldOptionsAbstract options) { FieldOptions = (TOptions)options; SetOptionsAndUpdateControls(FieldOptions); } public override void UpdateControls(FieldOptionsAbstract options) { SetOptionsAndUpdateControls((TOptions)options); } public virtual void SetOptionsAndUpdateControls(TOptions options) { FieldOptions = options; var commonControl = FindControl<UserControlCommonOptions>(); if (commonControl!= null) { commonControl.SetOptionsAndUpdateControls(options); } } public override FieldOptionsAbstract GetFieldOptions() { return GetFieldOptionsT(); } public virtual TOptions GetFieldOptionsT() { var commonControl = FindControl<UserControlCommonOptions>(); if (commonControl!= null) { FieldOptions.UseNullValues = commonControl.GetFieldOptionsT().UseNullValues; } return FieldOptions; } protected void InitEventsForControls() { foreach (var ctrl in FindControls<NumericUpDown>()) { ctrl.ValueChanged += HandleOptionsChangedChanged; } foreach (var ctrl in FindControls<RadioButton>()) { ctrl.CheckedChanged += HandleOptionsChangedChanged; } foreach (var ctrl in FindControls<CheckBox>()) { ctrl.CheckedChanged += HandleOptionsChangedChanged; } foreach (var ctrl in FindControls<TextBox>()) { ctrl.TextChanged += HandleOptionsChangedChanged; } foreach (var ctrl in FindControls<DateTimePicker>()) { ctrl.ValueChanged += HandleOptionsChangedChanged; } foreach (var ctrl in FindControls<ComboBox>()) { ctrl.SelectedValueChanged += HandleOptionsChangedChanged; } } protected T FindControl<T>() where T : class { return FindControls<T>().FirstOrDefault(); } protected IEnumerable<T> FindControls<T>() where T : class { return Controls.OfType<T>(); } } } ======================= File: src/RandomDataGenerator.Gui/Generation/GenerateSQL.cs ======================= <reponame>brunotarghetta/RandomDataGenerator using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using RandomDataGenerator.Gui.Entities; using RandomDataGenerator.Gui.Util; namespace RandomDataGenerator.Gui.Generation { public class GenerateSQL : Generate<GenerateOptionsSQL>, IGenerate { public GenerateSQL(GenerateOptionsSQL options) : base(options) { } public void Spawn(List<DataField> fields, int totalRecords, string fileName) { var sb = new StringBuilder(); string insertString = $"INSERT INTO [{Options.Table}] "; string includeFieldNamesString = Options.IncludeFieldNames? $"({string.Join(", ", fields.Select(f => $"[{f.Name}]"))})" : string.Empty; for (int r = 0; r < totalRecords / Options.RecordsPerInsert; r++) { WriteBatch(sb, insertString, includeFieldNamesString, fields, Options.RecordsPerInsert); } int additionalInserts = totalRecords % Options.RecordsPerInsert; if (additionalInserts > 0) { WriteBatch(sb, insertString, includeFieldNamesString, fields, additionalInserts); } File.WriteAllText(fileName, sb.ToString()); } private void WriteBatch(StringBuilder sb, string insertString, string includeFieldNamesString, List<DataField> fields, int numBatch) { sb.Append(insertString); sb.Append(includeFieldNamesString); sb.Append(" VALUES "); for (int batch = 0; batch < numBatch; batch++) { var fieldData = new List<string>(); foreach (var field in fields) { object randomValue = field.Generate(); string value = field.FieldOptions.ValueAsString? StringUtils.AddSQLQuotes(randomValue) : StringUtils.MakeSafeSQL(randomValue); fieldData.Add(value); } sb.Append($"({string.Join(", ", fieldData)})"); sb.Append(batch < numBatch - 1? ", " : ";"); } sb.AppendLine(); } } } ======================= File: src/RandomDataGenerator.Gui/Generation/BaseGenerateOptions.cs ======================= using System.Xml.Serialization; namespace RandomDataGenerator.Gui.Generation { [XmlInclude(typeof(GenerateOptionsSQL))] public abstract class BaseGenerateOptions { } } ======================= File: src/RandomDataGenerator.Gui/UserControlsFields/UserControlInteger.cs ======================= using System; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Gui.UserControls; namespace RandomDataGenerator.Gui.UserControlsFields { public sealed partial class UserControlInteger : UserControlIntegerDesignable { public UserControlInteger() { InitializeComponent(); InitEventsForControls(); } public override void SetOptionsAndUpdateControls(FieldOptionsInteger options) { base.SetOptionsAndUpdateControls(options); ctrlMin.Value = FieldOptions.Min; ctrlMax.Value = FieldOptions.Max; chkConvertToString.Checked = FieldOptions.ValueAsString; } public override FieldOptionsInteger GetFieldOptionsT() { FieldOptions = base.GetFieldOptionsT(); FieldOptions.Min = (int)ctrlMin.Value; FieldOptions.Max = (int)ctrlMax.Value; FieldOptions.ValueAsString = chkConvertToString.Checked; return FieldOptions; } private void MinValueChanged(object sender, EventArgs e) { ctrlMax.Minimum = ctrlMin.Value; } private void MaxValueChanged(object sender, EventArgs e) { ctrlMin.Maximum = ctrlMax.Value; } } // Workaround http://stackoverflow.com/questions/677609/generic-base-class-for-winform-usercontrol public class UserControlIntegerDesignable : BaseUserControl<FieldOptionsInteger> { } } ======================= File: src/RandomDataGenerator/Randomizers/RandomizerTextWords.cs ======================= using RandomDataGenerator.Data; using RandomDataGenerator.Extensions; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Generators; using System; using System.Collections.Generic; namespace RandomDataGenerator.Randomizers { public class RandomizerTextWords : RandomizerAbstract<FieldOptionsTextWords>, IRandomizerString { private readonly RandomStringFromListGenerator _generator; private readonly RandomValueGenerator _randomValueGenerator; public RandomizerTextWords(FieldOptionsTextWords options) : base(options) { _randomValueGenerator = new RandomValueGenerator(Options.Seed?? Environment.TickCount); _generator = new RandomStringFromListGenerator(ListData.Instance.LoremIpsumWords, options.Seed); } public string Generate() { if (IsNull()) { return null; } int max = _randomValueGenerator.Next(Options.Min, Options.Max); var list = new List<string>(max); for (int i = 0; i < max; i++) { list.Add(_generator.Generate()); } return string.Join(" ", list.ToArray()); } public string Generate(bool upperCase) { return Generate().ToCasedInvariant(upperCase); } } } ======================= File: src/RandomDataGenerator/Randomizers/RandomizerBytes.cs ======================= using System; using System.Text; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Generators; namespace RandomDataGenerator.Randomizers { public class RandomizerBytes : RandomizerAbstract<FieldOptionsBytes>, IRandomizerBytes { private readonly RandomValueGenerator _randomValueGenerator; public RandomizerBytes(FieldOptionsBytes options) : base(options) { _randomValueGenerator = new RandomValueGenerator(Options.Seed?? Environment.TickCount); } public byte[] Generate() { return _randomValueGenerator.NextBytes(Options.Min, Options.Max); } public string GenerateAsString(Encoding encoding) { return (encoding?? Encoding.UTF8).GetString(Generate()); } public string GenerateAsUTF8String() { return GenerateAsString(Encoding.UTF8); } public string GenerateAsASCIIString() { return GenerateAsString(Encoding.ASCII); } public string GenerateAsBase64String() { return Convert.ToBase64String(Generate()); } } } ======================= File: src/RandomDataGenerator/FieldOptions/FieldOptionsCountry.cs =======================  namespace RandomDataGenerator.FieldOptions { public class FieldOptionsCountry : FieldOptionsAbstract, IFieldOptionsString { } } ======================= File: src/RandomDataGenerator/Randomizers/RandomizerDateTime.cs ======================= <filename>src/RandomDataGenerator/Randomizers/RandomizerDateTime.cs using System; using System.Globalization; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Generators; namespace RandomDataGenerator.Randomizers { public class RandomizerDateTime : RandomizerAbstract<FieldOptionsDateTime>, IRandomizerDateTime { private readonly RandomThingsGenerator<DateTime> _generator; public RandomizerDateTime(FieldOptionsDateTime options) : base(options) { _generator = new RandomThingsGenerator<DateTime>(options.From, options.To, options.Seed); } public DateTime? Generate() { if (IsNull()) { return null; } DateTime value = _generator.Generate(); return Options.IncludeTime? value : value.Date; } public string GenerateAsString() { DateTime? date = Generate(); string format =!string.IsNullOrEmpty(Options.Format)? Options.Format : FieldOptionsDateTime.DefaultFormat; return date?.ToString(format, CultureInfo.InvariantCulture); } } } ======================= File: src/RandomDataGenerator/Randomizers/RandomizerTextLipsum.cs ======================= using RandomDataGenerator.Data; using RandomDataGenerator.Extensions; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Generators; namespace RandomDataGenerator.Randomizers { public class RandomizerTextLipsum : RandomizerAbstract<FieldOptionsTextLipsum>, IRandomizerString { private const string Newline = "\r\n"; private readonly RandomStringsFromListGenerator _generator; public RandomizerTextLipsum(FieldOptionsTextLipsum options) : base(options) { _generator = new RandomStringsFromListGenerator(ListData.Instance.LoremIpsum); } public string Generate() { return IsNull()? null : string.Join(Newline, _generator.Generate(Options.Paragraphs).ToArray()); } public string Generate(bool upperCase) { return Generate().ToCasedInvariant(upperCase); } } } ======================= File: src/RandomDataGenerator.Gui/Properties/AssemblyInfo.cs ======================= using System.Reflection; using System.Runtime.InteropServices; using RandomDataGenerator.Gui; [assembly: AssemblyTitle("RandomDataGenerator.Gui")] [assembly: AssemblyProduct("RandomDataGenerator.Gui")] [assembly: AssemblyCopyright(VersionInfo.AssemblyCopyright)] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("8a9214e0-3b23-4c66-9a1b-f06f2ddf70fd")] [assembly: AssemblyVersion(VersionInfo.AssemblyVersion)] [assembly: AssemblyFileVersion(VersionInfo.AssemblyFileVersion)] ======================= File: src/RandomDataGenerator.Gui/Entities/SubField.cs ======================= using System.Xml.Serialization; using RandomDataGenerator.Enums; using RandomDataGenerator.Gui.Extensions; namespace RandomDataGenerator.Gui.Entities { public class SubField { [XmlIgnore] public string Name => SubFieldType.GetEnumDescription(); public SubFieldType SubFieldType { get; set; } } } ======================= File: src/RandomDataGenerator.Gui/UserControlsFields/UserControlMACAddress.Designer.cs ======================= <filename>src/RandomDataGenerator.Gui/UserControlsFields/UserControlMACAddress.Designer.cs<gh_stars>10-100 namespace RandomDataGenerator.Gui.UserControlsFields { partial class UserControlMACAddress { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components!= null)) { components.Dispose(); } base.Dispose(disposing); } #region Component Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.chkAddColons = new System.Windows.Forms.CheckBox(); this.lblAddColons = new System.Windows.Forms.Label(); this.chkUppercase = new System.Windows.Forms.CheckBox(); this.lblUppercase = new System.Windows.Forms.Label(); this.SuspendLayout(); // // chkAddColons // this.chkAddColons.AutoSize = true; this.chkAddColons.Checked = true; this.chkAddColons.CheckState = System.Windows.Forms.CheckState.Checked; this.chkAddColons.Location = new System.Drawing.Point(108, 2); this.chkAddColons.Name = "chkAddColons"; this.chkAddColons.Size = new System.Drawing.Size(15, 14); this.chkAddColons.TabIndex = 7; this.chkAddColons.UseVisualStyleBackColor = true; // // lblAddColons // this.lblAddColons.AutoSize = true; this.lblAddColons.Location = new System.Drawing.Point(4, 2); this.lblAddColons.Name = "lblAddColons"; this.lblAddColons.Size = new System.Drawing.Size(84, 13); this.lblAddColons.TabIndex = 6; this.lblAddColons.Text = "Add colons (:::::)"; // // chkUppercase // this.chkUppercase.AutoSize = true; this.chkUppercase.Checked = true; this.chkUppercase.CheckState = System.Windows.Forms.CheckState.Checked; this.chkUppercase.Location = new System.Drawing.Point(108, 30); this.chkUppercase.Name = "chkUppercase"; this.chkUppercase.Size = new System.Drawing.Size(15, 14); this.chkUppercase.TabIndex = 9; this.chkUppercase.UseVisualStyleBackColor = true; // // lblUppercase // this.lblUppercase.AutoSize = true; this.lblUppercase.Location = new System.Drawing.Point(4, 30); this.lblUppercase.Name = "lblUppercase"; this.lblUppercase.Size = new System.Drawing.Size(59, 13); this.lblUppercase.TabIndex = 8; this.lblUppercase.Text = "Uppercase"; // // UserControlMACAddress // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.chkUppercase); this.Controls.Add(this.lblUppercase); this.Controls.Add(this.chkAddColons); this.Controls.Add(this.lblAddColons); this.Name = "UserControlMACAddress"; this.Size = new System.Drawing.Size(350, 76); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.CheckBox chkAddColons; private System.Windows.Forms.Label lblAddColons; private System.Windows.Forms.CheckBox chkUppercase; private System.Windows.Forms.Label lblUppercase; } } ======================= File: src/RandomDataGenerator/FieldOptions/FieldOptionsBoolean.cs =======================  namespace RandomDataGenerator.FieldOptions { public class FieldOptionsBoolean : FieldOptionsNumber<bool> { } } ======================= File: src/RandomDataGenerator.Gui/UserControlsFields/UserControlTextNaughtyStrings.cs ======================= using System; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Gui.UserControls; namespace RandomDataGenerator.Gui.UserControlsFields { public sealed partial class UserControlTextNaughtyStrings : UserControlTextNaughtyStringsDesignable { public UserControlTextNaughtyStrings() { InitializeComponent(); InitEventsForControls(); } public override void SetOptionsAndUpdateControls(FieldOptionsTextNaughtyStrings options) { base.SetOptionsAndUpdateControls(options); txtCategories.Text = FieldOptions.Categories; } public override FieldOptionsTextNaughtyStrings GetFieldOptionsT() { FieldOptions = base.GetFieldOptionsT(); FieldOptions.Categories = txtCategories.Text; return FieldOptions; } } // Workaround http://stackoverflow.com/questions/677609/generic-base-class-for-winform-usercontrol public class UserControlTextNaughtyStringsDesignable : BaseUserControl<FieldOptionsTextNaughtyStrings> { } } ======================= File: src/RandomDataGenerator/FieldOptions/FieldOptionsTextNaughtyStrings.cs ======================= <gh_stars>10-100 namespace RandomDataGenerator.FieldOptions { public class FieldOptionsTextNaughtyStrings : FieldOptionsAbstract, IFieldOptionsString { internal static string All = "All"; /// <summary> /// A comma separated string from one or more from these categories: /// /// All /// Changinglengthwhenlowercased /// CommandInjectionRuby /// Emoji /// FileInclusion /// Humaninjection /// JapaneseEmoticons /// KnownCVEsandVulnerabilities /// MSDOSWindowsSpecialFilenames /// NumericStrings /// OghamText /// QuotationMarks /// ReservedStrings /// RightToLeftStrings /// SQLInjection /// ScriptInjection /// ScunthorpeProblem /// ServerCodeInjection /// SpecialCharacters /// SpecialUnicodeCharactersUnion /// Stringswhichcontaintwobyteletters /// Terminalescapecodes /// TrickUnicode /// TwoByteCharacters /// UnicodeNumbers /// UnicodeSubscriptSuperscriptAccents /// UnicodeSymbols /// UnicodeUpsidedown /// Unicodefont /// UnwantedInterpolation /// ZalgoText /// iOSVulnerabilities /// /// When null, the 'All' category is used. /// </summary> public string Categories { get; set; } = All; } } ======================= File: src/RandomDataGenerator/FieldOptions/FieldOptionsFactory.cs ======================= <gh_stars>10-100 using System; using System.Collections.Generic; using System.Reflection; using JetBrains.Annotations; using RandomDataGenerator.Enums; using RandomDataGenerator.Validation; namespace RandomDataGenerator.FieldOptions { public static class FieldOptionsFactory { private const string Namespace = "RandomDataGenerator.FieldOptions"; public static FieldOptionsAbstract GetFieldOptions(SubFieldType subFieldType) { Type type = Type.GetType($"{Namespace}.FieldOptions{subFieldType}", true); return (FieldOptionsAbstract)Activator.CreateInstance(type); } public static FieldOptionsAbstract GetFieldOptions([NotNull] string name, [NotNull] Dictionary<string, object> properties) { Check.NotNullOrEmpty(name, nameof(name)); Check.NotNull(properties, nameof(properties)); // Generate classname string className =!name.StartsWith("FieldOptions")? $"FieldOptions{name}" : name; // Create type based on classname Type type = Type.GetType($"{Namespace}.{className}", true); var fieldOptions = (FieldOptionsAbstract)Activator.CreateInstance(type); // Loop all settable properties and set value if it's defined as an argument foreach (PropertyInfo propertyInfo in type.GetPublicSettableProperties()) { bool exists = properties.ContainsKey(propertyInfo.Name); if (exists) { propertyInfo.SetValue(fieldOptions, properties[propertyInfo.Name], null); } } return fieldOptions; } } } ======================= File: src/RandomDataGenerator/Randomizers/RandomizerTextRegex.cs ======================= <filename>src/RandomDataGenerator/Randomizers/RandomizerTextRegex.cs using System; using Fare; using RandomDataGenerator.Extensions; using RandomDataGenerator.FieldOptions; namespace RandomDataGenerator.Randomizers { public class RandomizerTextRegex : RandomizerAbstract<FieldOptionsTextRegex>, IRandomizerString { private readonly Xeger _generator; public RandomizerTextRegex(FieldOptionsTextRegex options) : base(options) { _generator = options.Seed.HasValue? new Xeger(options.Pattern, new Random(options.Seed.Value)) : new Xeger(options.Pattern); } public string Generate() { return IsNull() || string.IsNullOrEmpty(Options.Pattern)? null : _generator.Generate(); } public string Generate(bool upperCase) { return Generate().ToCasedInvariant(upperCase); } } } ======================= File: src/RandomDataGenerator.Gui/Entities/IDataField.cs =======================  namespace RandomDataGenerator.Gui.Entities { interface IDataField { object Generate(); } } ======================= File: src/RandomDataGenerator.Gui/UserControlsFields/UserControlMACAddress.cs ======================= using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Gui.UserControls; namespace RandomDataGenerator.Gui.UserControlsFields { public partial class UserControlMACAddress : UserControlMACAddressDesignable { public UserControlMACAddress() { InitializeComponent(); InitEventsForControls(); } public override void SetOptionsAndUpdateControls(FieldOptionsMACAddress options) { base.SetOptionsAndUpdateControls(options); chkAddColons.Checked = FieldOptions.Separator == ":"; chkUppercase.Checked = FieldOptions.Uppercase; } public override FieldOptionsMACAddress GetFieldOptionsT() { FieldOptions = base.GetFieldOptionsT(); FieldOptions.Separator = chkAddColons.Checked? ":" : string.Empty; FieldOptions.Uppercase = chkUppercase.Checked; return FieldOptions; } } // Workaround http://stackoverflow.com/questions/677609/generic-base-class-for-winform-usercontrol public class UserControlMACAddressDesignable : BaseUserControl<FieldOptionsMACAddress> { } } ======================= File: src/RandomDataGenerator/Randomizers/RandomizerTimeSpan.cs ======================= <reponame>brunotarghetta/RandomDataGenerator<filename>src/RandomDataGenerator/Randomizers/RandomizerTimeSpan.cs using System; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Generators; namespace RandomDataGenerator.Randomizers { public class RandomizerTimeSpan : RandomizerAbstract<FieldOptionsTimeSpan>, IRandomizerTimeSpan { private readonly RandomThingsGenerator<TimeSpan> _generator; public RandomizerTimeSpan(FieldOptionsTimeSpan options) : base(options) { _generator = new RandomThingsGenerator<TimeSpan>(options.From, options.To, options.Seed); } public TimeSpan? Generate() { if (IsNull()) { return null; } var ts = _generator.Generate(); return Options.IncludeMilliseconds? ts : new TimeSpan(ts.Days, ts.Hours, ts.Minutes, ts.Seconds); } public string GenerateAsString() { TimeSpan? ts = Generate(); string format =!string.IsNullOrEmpty(Options.Format)? Options.Format : FieldOptionsTimeSpan.DefaultFormat; return ts!= null? string.Format($"{{0:{format}}}", ts) : null; } } } ======================= File: src/RandomDataGenerator/FieldOptions/FieldOptionsTextRegex.cs ======================= namespace RandomDataGenerator.FieldOptions { public class FieldOptionsTextRegex : FieldOptionsAbstract, IFieldOptionsString { /// <summary> /// Use any valid Regex pattern to generate a string. /// </summary> public string Pattern { get; set; } } } ======================= File: src/RandomDataGenerator/Randomizers/RandomizerIPv4Address.cs ======================= <reponame>brunotarghetta/RandomDataGenerator<filename>src/RandomDataGenerator/Randomizers/RandomizerIPv4Address.cs using System.Linq; using RandomDataGenerator.Extensions; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Generators; namespace RandomDataGenerator.Randomizers { public class RandomizerIPv4Address : RandomizerAbstract<FieldOptionsIPv4Address>, IRandomizerString { private readonly RandomThingsGenerator<byte>[] _octetsGenerator = new RandomThingsGenerator<byte>[4]; public RandomizerIPv4Address(FieldOptionsIPv4Address options) : base(options) { byte[] octetsMin = string.IsNullOrEmpty(Options.Min)? new byte[] { 0, 0, 0, 0 } : Options.Min.Split('.').Select(x => byte.Parse(x)).ToArray(); byte[] octetsMax = string.IsNullOrEmpty(Options.Max)? new byte[] { 0xff, 0xff, 0xff, 0xff } : Options.Max.Split('.').Select(x => byte.Parse(x)).ToArray(); for (int i = 0; i < 4; i++) { _octetsGenerator[i] = new RandomThingsGenerator<byte>(octetsMin[i], octetsMax[i], options.Seed); } } public string Generate() { if (IsNull()) { return null; } return string.Join(".", _octetsGenerator.Select(gen => $"{gen.Generate()}").ToArray()); } public string Generate(bool upperCase) { return Generate().ToCasedInvariant(upperCase); } } } ======================= File: src/RandomDataGenerator.Gui/UserControlsFields/UserControlCountry.cs ======================= <gh_stars>10-100 using System; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Gui.UserControls; namespace RandomDataGenerator.Gui.UserControlsFields { public partial class UserControlCountry : UserControlCountryDesignable { public UserControlCountry() { InitializeComponent(); base.OnOptionsChanged(EventArgs.Empty); } } // Workaround http://stackoverflow.com/questions/677609/generic-base-class-for-winform-usercontrol public class UserControlCountryDesignable : BaseUserControl<FieldOptionsCountry> { } } ======================= File: src/RandomDataGenerator.Gui/UserControls/UserControlFactory.cs ======================= using System; using RandomDataGenerator.FieldOptions; namespace RandomDataGenerator.Gui.UserControls { static class UserControlFactory { public static IUserControl GetUserControl(FieldOptionsAbstract fieldOptions) { string typeName = fieldOptions.GetType().FullName .Replace("RandomDataGenerator.FieldOptions.FieldOptions", "RandomDataGenerator.Gui.UserControlsFields.UserControl"); var type = Type.GetType(typeName); if (type!= null) { var userControl = (IUserControl)Activator.CreateInstance(type, new object[] { }); userControl.SetOptions(fieldOptions); return userControl; } return null; } } } ======================= File: src/RandomDataGenerator/Randomizers/RandomizerFactory.cs ======================= using System; using System.Collections.Concurrent; using System.Linq; using System.Reflection; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Generators; namespace RandomDataGenerator.Randomizers { public static class RandomizerFactory { private static readonly ConcurrentDictionary<string, object> Cache = new ConcurrentDictionary<string, object>(); public static IRandomizerBytes GetRandomizer(IFieldOptionsBytes fieldOptions) { return Create<IRandomizerBytes>(fieldOptions); } public static IRandomizerString GetRandomizer(IFieldOptionsString fieldOptions) { return Create<IRandomizerString>(fieldOptions); } public static IRandomizerGuid GetRandomizer(IFieldOptionsGuid fieldOptions) { return Create<IRandomizerGuid>(fieldOptions); } public static IRandomizerNumber<T> GetRandomizer<T>(IFieldOptionsNumber<T> fieldOptions) where T : struct { return Create<IRandomizerNumber<T>>(fieldOptions); } public static IRandomizerDateTime GetRandomizer(IFieldOptionsDateTime fieldOptions) { return Create<IRandomizerDateTime>(fieldOptions); } public static IRandomizerTimeSpan GetRandomizer(IFieldOptionsTimeSpan fieldOptions) { return Create<IRandomizerTimeSpan>(fieldOptions); } #if NET20 || NET35 public static object GetRandomizerAsDynamic(FieldOptionsAbstract fieldOptions) { return Create<object>(fieldOptions); } #else public static dynamic GetRandomizerAsDynamic(object fieldOptions) { return Create<object>(fieldOptions); } #endif private static T Create<T>(object fieldOptions) { string key = $"{fieldOptions.GetType().FullName}_{fieldOptions.GetHashCode()}"; if (!Cache.ContainsKey(key)) { Cache.TryAdd(key, CreateRandomizer(fieldOptions)); } return (T)Cache[key]; } private static object CreateRandomizer(object fieldOptions) { Type fieldOptionsType = fieldOptions.GetType(); string fieldOptionsFullName = fieldOptionsType.FullName?? string.Empty; string typeName; if (fieldOptionsType.GetTypeInfo().BaseType?.Name.EndsWith("Number`1") == true) { Type genericType = fieldOptionsType.GetTypeInfo().BaseType.GetTypeInfo().GetGenericTypeArguments().FirstOrDefault(); if (RandomValueGenerator.SupportedTypes.Contains(genericType)) { typeName = fieldOptionsFullName.Replace($"FieldOptions.{fieldOptionsType.Name}", $"Randomizers.RandomizerNumber`1[{genericType}]"); } else { throw new NotSupportedException($"The type '{genericType}' is not supported."); } } else { typeName = fieldOptionsFullName.Replace("FieldOptions.FieldOptions", "Randomizers.Randomizer"); } var type = Type.GetType(typeName, true); return Activator.CreateInstance(type, fieldOptions); } } } ======================= File: src/RandomDataGenerator.Gui/Properties/Resources.Designer.cs ======================= <reponame>brunotarghetta/RandomDataGenerator<gh_stars>10-100 //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace RandomDataGenerator.Gui.Properties { using System; /// <summary> /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your.ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RandomDataGenerator.Gui.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } /// <summary> /// Looks up a localized resource of type System.Drawing.Bitmap. /// </summary> internal static System.Drawing.Bitmap add { get { object obj = ResourceManager.GetObject("add", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } /// <summary> /// Looks up a localized resource of type System.Drawing.Bitmap. /// </summary> internal static System.Drawing.Bitmap arrow_down { get { object obj = ResourceManager.GetObject("arrow_down", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } /// <summary> /// Looks up a localized resource of type System.Drawing.Bitmap. /// </summary> internal static System.Drawing.Bitmap arrow_refresh_small { get { object obj = ResourceManager.GetObject("arrow_refresh_small", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } /// <summary> /// Looks up a localized resource of type System.Drawing.Bitmap. /// </summary> internal static System.Drawing.Bitmap arrow_up { get { object obj = ResourceManager.GetObject("arrow_up", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } /// <summary> /// Looks up a localized resource of type System.Drawing.Bitmap. /// </summary> internal static System.Drawing.Bitmap delete { get { object obj = ResourceManager.GetObject("delete", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } /// <summary> /// Looks up a localized resource of type System.Drawing.Bitmap. /// </summary> internal static System.Drawing.Bitmap disk { get { object obj = ResourceManager.GetObject("disk", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } /// <summary> /// Looks up a localized string similar to Error Loading. /// </summary> internal static string ErrorLoad { get { return ResourceManager.GetString("ErrorLoad", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Error Saving. /// </summary> internal static string ErrorSave { get { return ResourceManager.GetString("ErrorSave", resourceCulture); } } /// <summary> /// Looks up a localized string similar to SQL Script (*.sql)|*.sql|All files (*.*)|*.*. /// </summary> internal static string FileFilter_sql_all { get { return ResourceManager.GetString("FileFilter_sql_all", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Project Settings (*.xml)|*.xml|All files (*.*)|*.*. /// </summary> internal static string FileFilter_xml_all { get { return ResourceManager.GetString("FileFilter_xml_all", resourceCulture); } } /// <summary> /// Looks up a localized resource of type System.Drawing.Bitmap. /// </summary> internal static System.Drawing.Bitmap folder_database { get { object obj = ResourceManager.GetObject("folder_database", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } /// <summary> /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// </summary> internal static System.Drawing.Icon icon { get { object obj = ResourceManager.GetObject("icon", resourceCulture); return ((System.Drawing.Icon)(obj)); } } /// <summary> /// Looks up a localized string similar to Load settings. /// </summary> internal static string LoadSettings { get { return ResourceManager.GetString("LoadSettings", resourceCulture); } } /// <summary> /// Looks up a localized string similar to New Field Added. /// </summary> internal static string NewFieldAdded { get { return ResourceManager.GetString("NewFieldAdded", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Generated {0} records to {1}. /// </summary> internal static string Output_GeneratedRecords { get { return ResourceManager.GetString("Output_GeneratedRecords", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Project Settings Loaded from {0}. /// </summary> internal static string ProjectSettingsLoaded { get { return ResourceManager.GetString("ProjectSettingsLoaded", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Project Settings Saved to {0}. /// </summary> internal static string ProjectSettingsSaved { get { return ResourceManager.GetString("ProjectSettingsSaved", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Remove Field?. /// </summary> internal static string RemoveField { get { return ResourceManager.GetString("RemoveField", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Save this table. /// </summary> internal static string SaveThisTable { get { return ResourceManager.GetString("SaveThisTable", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Select output file. /// </summary> internal static string SelectOutputFile { get { return ResourceManager.GetString("SelectOutputFile", resourceCulture); } } /// <summary> /// Looks up a localized resource of type System.Drawing.Bitmap. /// </summary> internal static System.Drawing.Bitmap table_save { get { object obj = ResourceManager.GetObject("table_save", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } } } ======================= File: src/RandomDataGenerator/Randomizers/RandomizerCountry.cs ======================= <filename>src/RandomDataGenerator/Randomizers/RandomizerCountry.cs using RandomDataGenerator.Data; using RandomDataGenerator.Extensions; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Generators; namespace RandomDataGenerator.Randomizers { public class RandomizerCountry : RandomizerAbstract<FieldOptionsCountry>, IRandomizerString { private readonly RandomStringFromListGenerator _generator; public RandomizerCountry(FieldOptionsCountry options) : base(options) { _generator = new RandomStringFromListGenerator(ListData.Instance.CountryNames); } public string Generate() { return IsNull()? null : _generator.Generate(); } public string Generate(bool upperCase) { return Generate().ToCasedInvariant(upperCase); } } } ======================= File: src/RandomDataGenerator.Gui/UserControlsFields/UserControlFirstName.cs ======================= <gh_stars>10-100 using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Gui.UserControls; namespace RandomDataGenerator.Gui.UserControlsFields { public sealed partial class UserControlFirstName : UserControlFirstNameDesignable { public UserControlFirstName() { InitializeComponent(); InitEventsForControls(); } public override void SetOptionsAndUpdateControls(FieldOptionsFirstName options) { base.SetOptionsAndUpdateControls(options); if (FieldOptions.Male && FieldOptions.Female) { rbBoth.Checked = true; } else { rbMale.Checked = FieldOptions.Male; rbFemale.Checked = FieldOptions.Female; } } public override FieldOptionsFirstName GetFieldOptionsT() { FieldOptions = base.GetFieldOptionsT(); FieldOptions.Male = rbBoth.Checked || rbMale.Checked; FieldOptions.Female = rbBoth.Checked || rbFemale.Checked; return FieldOptions; } } // Workaround http://stackoverflow.com/questions/677609/generic-base-class-for-winform-usercontrol public class UserControlFirstNameDesignable : BaseUserControl<FieldOptionsFirstName> { } } ======================= File: src/RandomDataGenerator/Randomizers/RandomizerStringList.cs ======================= <gh_stars>10-100 using RandomDataGenerator.Extensions; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Generators; namespace RandomDataGenerator.Randomizers { public class RandomizerStringList : RandomizerAbstract<FieldOptionsStringList>, IRandomizerString { private readonly RandomStringFromListGenerator _generator; public RandomizerStringList(FieldOptionsStringList options) : base(options) { _generator = new RandomStringFromListGenerator(options.Values); } public string Generate() { return IsNull()? null : _generator.Generate(); } public string Generate(bool upperCase) { return IsNull()? null : _generator.Generate().ToCasedInvariant(upperCase); } } } ======================= File: src/RandomDataGenerator/FieldOptions/FieldOptionsTimeSpan.cs ======================= using System; namespace RandomDataGenerator.FieldOptions { public class FieldOptionsTimeSpan : FieldOptionsAbstract, IFieldOptionsTimeSpan { public const string DefaultFormat = "c"; // "c" -> Constant (invariant) format public string Format { get; set; } = DefaultFormat; public bool IncludeMilliseconds { get; set; } = true; public TimeSpan From { get; set; } public TimeSpan To { get; set; } = TimeSpan.MaxValue; } } ======================= File: src/RandomDataGenerator.Gui/UserControlsFields/UserControlCommonOptions.cs ======================= <reponame>brunotarghetta/RandomDataGenerator<filename>src/RandomDataGenerator.Gui/UserControlsFields/UserControlCommonOptions.cs using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Gui.UserControls; namespace RandomDataGenerator.Gui.UserControlsFields { public sealed partial class UserControlCommonOptions : UserControlCommonOptionsDesignable { public UserControlCommonOptions() { InitEventsForControls(); InitializeComponent(); } public override void SetOptionsAndUpdateControls(FieldOptionsAbstract options) { base.SetOptionsAndUpdateControls(options); chkAllowNull.Checked = FieldOptions.UseNullValues; } public override FieldOptionsAbstract GetFieldOptionsT() { FieldOptions.UseNullValues = chkAllowNull.Checked; return FieldOptions; } } // Workaround http://stackoverflow.com/questions/677609/generic-base-class-for-winform-usercontrol public class UserControlCommonOptionsDesignable : BaseUserControl<FieldOptionsAbstract> { } } ======================= File: src/RandomDataGenerator.Gui/MainForm.Project.cs ======================= <filename>src/RandomDataGenerator.Gui/MainForm.Project.cs using System; using System.Linq; using System.Windows.Forms; using RandomDataGenerator.Gui.Entities; using RandomDataGenerator.Gui.Extensions; using RandomDataGenerator.Gui.Generation; using RandomDataGenerator.Gui.Project; using RandomDataGenerator.Gui.Properties; using RandomDataGenerator.Gui.UserControls; namespace RandomDataGenerator.Gui { public partial class MainForm { private string _projectSettingsFileName; private void ClickEventMenuSave(object sender, EventArgs e) { var userControlSQL = (BaseUserControlOutput<GenerateOptionsSQL>)panelOutput.FindControl<UserControlOutputSQL>(); var settings = new ProjectSettings { Date = DateTime.Now, Name = userControlSQL.GetGenerateOptions().Table, DataFields = listBoxFields.Items.OfType<DataField>().ToList(), GenerateOptions = userControlSQL.GetGenerateOptions(), OutputFile = txtOutputFile.Text, TotalRecords = (int)numTotalRecords.Value }; var fileBrowser = new SaveFileDialog { Filter = Resources.FileFilter_xml_all, Title = Resources.SaveThisTable, FileName = settings.Name + ".xml" }; var result = fileBrowser.ShowDialog(); if (result == DialogResult.OK) { _projectSettingsFileName = fileBrowser.FileName; ProjectHelper.Save(settings, _projectSettingsFileName); toolStripStatusLabel1.Text = string.Format(Resources.ProjectSettingsSaved, _projectSettingsFileName); } } private void ClickEventMenuLoad(object sender, EventArgs e) { var fileBrowser = new OpenFileDialog { Filter = Resources.FileFilter_xml_all, Title = Resources.LoadSettings, FileName = _projectSettingsFileName }; var result = fileBrowser.ShowDialog(); if (result == DialogResult.OK) { _projectSettingsFileName = fileBrowser.FileName; var settings = ProjectHelper.Load(_projectSettingsFileName); txtOutputFile.Text = settings.OutputFile; numTotalRecords.Value = settings.TotalRecords; var generateOptions = (GenerateOptionsSQL)settings.GenerateOptions; var userControlSQL = (BaseUserControlOutput<GenerateOptionsSQL>)panelOutput.FindControl<UserControlOutputSQL>(); userControlSQL.UpdateControls(generateOptions); listBoxFields.SelectedIndexChanged -= listBoxFields_SelectedIndexChanged; _dataFields.Clear(); foreach (var dataField in settings.DataFields) { // Fix Field and SubField var field = _fieldManager.GetFields().First(f => f.Name == dataField.Field.Name); dataField.Field = field; dataField.SubField = field.SubFields.First(sf => sf.Name == dataField.SubField.Name); _dataFields.Add(dataField); } listBoxFields.SelectedIndex = -1; listBoxFields.SelectedIndexChanged += listBoxFields_SelectedIndexChanged; toolStripStatusLabel1.Text = string.Format(Resources.ProjectSettingsLoaded, _projectSettingsFileName); } } private void ClickEventMenuExit(object sender, EventArgs e) { Application.Exit(); } } } ======================= File: src/RandomDataGenerator/Randomizers/IRandomizerString.cs ======================= namespace RandomDataGenerator.Randomizers { public interface IRandomizerString { string Generate(); string Generate(bool upperCase); } } ======================= File: src/RandomDataGenerator/Randomizers/RandomizerLastName.cs ======================= <reponame>brunotarghetta/RandomDataGenerator<gh_stars>10-100 using RandomDataGenerator.Data; using RandomDataGenerator.Extensions; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Generators; namespace RandomDataGenerator.Randomizers { public class RandomizerLastName : RandomizerAbstract<FieldOptionsLastName>, IRandomizerString { private readonly RandomStringFromListGenerator _lastNamesGenerator; public RandomizerLastName(FieldOptionsLastName options) : base(options) { _lastNamesGenerator = new RandomStringFromListGenerator(ListData.Instance.LastNames); } public string Generate() { return IsNull()? null : _lastNamesGenerator.Generate(); } public string Generate(bool upperCase) { return Generate().ToCasedInvariant(upperCase); } } } ======================= File: src/RandomDataGenerator.Gui/UserControlsFields/UserControlTextRegex.Designer.cs ======================= <reponame>brunotarghetta/RandomDataGenerator namespace RandomDataGenerator.Gui.UserControlsFields { sealed partial class UserControlTextRegex { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components!= null)) { components.Dispose(); } base.Dispose(disposing); } #region Component Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.lbPat = new System.Windows.Forms.Label(); this.lblInfo = new System.Windows.Forms.Label(); this.txtPattern = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // lbPat // this.lbPat.AutoSize = true; this.lbPat.Location = new System.Drawing.Point(6, 11); this.lbPat.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lbPat.Name = "lbPat"; this.lbPat.Size = new System.Drawing.Size(61, 20); this.lbPat.TabIndex = 0; this.lbPat.Text = "Pattern"; // // lblInfo // this.lblInfo.AutoSize = true; this.lblInfo.Location = new System.Drawing.Point(182, 78); this.lblInfo.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lblInfo.Name = "lblInfo"; this.lblInfo.Size = new System.Drawing.Size(0, 20); this.lblInfo.TabIndex = 7; // // txtPattern // this.txtPattern.Location = new System.Drawing.Point(76, 6); this.txtPattern.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtPattern.Name = "txtPattern"; this.txtPattern.Size = new System.Drawing.Size(238, 26); this.txtPattern.TabIndex = 8; this.txtPattern.Text = "[a-z]{4}"; // // label1 // this.label1.BackColor = System.Drawing.SystemColors.Info; this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label1.Location = new System.Drawing.Point(6, 43); this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(371, 41); this.label1.TabIndex = 9; this.label1.Text = "Just use any valid Regex to generate a string."; // // UserControlTextRegex // this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.label1); this.Controls.Add(this.txtPattern); this.Controls.Add(this.lblInfo); this.Controls.Add(this.lbPat); this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.Name = "UserControlTextRegex"; this.Size = new System.Drawing.Size(585, 180); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.Label lbPat; private System.Windows.Forms.Label lblInfo; private System.Windows.Forms.TextBox txtPattern; private System.Windows.Forms.Label label1; } } ======================= File: src/RandomDataGenerator/Randomizers/IRandomizerGuid.cs ======================= using System; namespace RandomDataGenerator.Randomizers { public interface IRandomizerGuid { Guid? Generate(); string GenerateAsString(); } } ======================= File: src/RandomDataGenerator/FieldOptions/IFieldOptionsTimeSpan.cs ======================= using System; namespace RandomDataGenerator.FieldOptions { public interface IFieldOptionsTimeSpan { /// <summary> /// Allowed values are "c", "g" and "G". /// See https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-timespan-format-strings /// </summary> string Format { get; set; } TimeSpan From { get; set; } TimeSpan To { get; set; } } } ======================= File: src/RandomDataGenerator.Gui/MainForm.Fields.cs ======================= <reponame>brunotarghetta/RandomDataGenerator using System; using System.ComponentModel; using System.Windows.Forms; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Gui.Entities; using RandomDataGenerator.Gui.Extensions; using RandomDataGenerator.Gui.UserControls; namespace RandomDataGenerator.Gui { public partial class MainForm { void cmbFields_SelectedValueChanged(object sender, EventArgs e) { var cmb = (ComboBox)sender; var selectedValue = (Field)cmb.SelectedItem; cmbSubFields.DataSource = selectedValue.SubFields; } void cmbSubFields_SelectedValueChanged(object sender, EventArgs e) { // Remove Current var oldControl = panelFieldOptions.FindControl<IUserControl>(); if (oldControl!= null) { var baseUserControl = oldControl as BaseUserControl; if (baseUserControl!= null) { baseUserControl.OptionsChanged -= UpdateUserControlExampleText; } ((UserControl)oldControl).Dispose(); } var cmb = (ComboBox)sender; var selectedValue = (SubField)cmb.SelectedItem; var subFieldType = selectedValue.SubFieldType; var fieldOptions = FieldOptionsFactory.GetFieldOptions(subFieldType); var userControl = UserControlFactory.GetUserControl(fieldOptions); if (userControl!= null) { var control = (Control)userControl; var baseUserControl = (BaseUserControl)userControl; baseUserControl.OptionsChanged += UpdateUserControlExampleText; UpdateUserControlExampleText(userControl, EventArgs.Empty); control.Dock = DockStyle.Top; control.Location = new System.Drawing.Point(0, 0); control.Name = "userControl_" + baseUserControl.GetType().Name; control.TabIndex = 2; panelFieldOptions.Controls.Add(control); } } #region Example UserControl void UpdateUserControlExampleText(object sender, EventArgs e) { var baseUserControl = (BaseUserControl)sender; UpdateUserControlExampleText(baseUserControl); } void UserControlExample_RefreshClicked(object sender, EventArgs e) { var baseUserControl = panelFieldOptions.FindControl<BaseUserControl>(); UpdateUserControlExampleText(baseUserControl); } private void UpdateUserControlExampleText(BaseUserControl baseUserControl) { var dummyDataField = new DataField(null, baseUserControl.GetFieldOptions(), null, null); object value = "N/A"; try { value = dummyDataField.Generate(); } catch (Exception e) { // Just ignore exception } userControlExample.txtExample.Text = value!= null? value.ToString() : "NULL"; } #endregion } } ======================= File: src/RandomDataGenerator/FieldOptions/FieldOptionsNumber.cs ======================= <gh_stars>10-100 namespace RandomDataGenerator.FieldOptions { public abstract class FieldOptionsNumber<T> : FieldOptionsAbstract, IFieldOptionsNumber<T> where T : struct { public virtual T Min { get; set; } public virtual T Max { get; set; } } } ======================= File: src/RandomDataGenerator/Compatibility/CustomIntrospectionExtensions.cs ======================= using System.Linq; // ReSharper disable once CheckNamespace namespace System.Reflection { /// <summary> /// https://github.com/castleproject/Core/blob/netcore/src/Castle.Core/Compatibility/IntrospectionExtensions.cs /// </summary> internal static class CustomIntrospectionExtensions { #if NET20 || NET35 public static Type GetTypeInfo(this Type type) { return type; } public static Type[] GetGenericTypeArguments(this Type type) { return type.GetGenericArguments(); } #else public static Type[] GetGenericTypeArguments(this TypeInfo typeInfo) { return typeInfo.GenericTypeArguments; } #endif public static PropertyInfo[] GetPublicSettableProperties(this Type type) { #if NET20 || NET35 return type.GetProperties(BindingFlags.Instance | BindingFlags.SetProperty | BindingFlags.Public); #else return type.GetTypeInfo().DeclaredProperties.Where(pi => pi.CanWrite).ToArray(); #endif } } } ======================= File: src/RandomDataGenerator.Gui/UserControlsFields/UserControlCity.cs ======================= <filename>src/RandomDataGenerator.Gui/UserControlsFields/UserControlCity.cs using System; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Gui.UserControls; namespace RandomDataGenerator.Gui.UserControlsFields { public partial class UserControlCity : UserControlCityDesignable { public UserControlCity() { InitializeComponent(); base.OnOptionsChanged(EventArgs.Empty); } } // Workaround http://stackoverflow.com/questions/677609/generic-base-class-for-winform-usercontrol public class UserControlCityDesignable : BaseUserControl<FieldOptionsCity> { } } ======================= File: src/RandomDataGenerator/Randomizers/IRandomizerTimeSpan.cs ======================= <filename>src/RandomDataGenerator/Randomizers/IRandomizerTimeSpan.cs using System; namespace RandomDataGenerator.Randomizers { public interface IRandomizerTimeSpan { TimeSpan? Generate(); string GenerateAsString(); } } ======================= File: src/RandomDataGenerator/FieldOptions/FieldOptionsBytes.cs =======================  namespace RandomDataGenerator.FieldOptions { public class FieldOptionsBytes : FieldOptionsAbstract, IFieldOptionsBytes { public int Min { get; set; } public int Max { get; set; } = 1024; } } ======================= File: src/RandomDataGenerator/FieldOptions/FieldOptionsFloat.cs =======================  namespace RandomDataGenerator.FieldOptions { public class FieldOptionsFloat : FieldOptionsNumber<float> { public override float Min { get; set; } public override float Max { get; set; } = float.MaxValue; } } ======================= File: src/RandomDataGenerator.Gui/Project/ProjectHelper.cs ======================= using System; using System.IO; using System.Windows.Forms; using System.Xml.Serialization; using RandomDataGenerator.Gui.Properties; namespace RandomDataGenerator.Gui.Project { public static class ProjectHelper { public static void Save(ProjectSettings settings, string fileName) { try { var xmlSerializer = new XmlSerializer(settings.GetType()); using (var streamWriter = new StreamWriter(fileName)) { xmlSerializer.Serialize(streamWriter, settings); } } catch (Exception e) { MessageBox.Show(e.ToString(), Resources.ErrorSave, MessageBoxButtons.OK, MessageBoxIcon.Error); } } public static ProjectSettings Load(string fileName) { if (!File.Exists(fileName)) { return null; } using (var fileStreamReader = File.OpenText(fileName)) { var xmlSerializer = new XmlSerializer(typeof(ProjectSettings)); try { return (ProjectSettings)xmlSerializer.Deserialize(fileStreamReader); } catch (Exception e) { MessageBox.Show(e.ToString(), Resources.ErrorLoad, MessageBoxButtons.OK, MessageBoxIcon.Error); return null; } } } } } ======================= File: src/RandomDataGenerator.Gui/UserControlsFields/UserControlGUID.Designer.cs ======================= <reponame>brunotarghetta/RandomDataGenerator namespace RandomDataGenerator.Gui.UserControlsFields { partial class UserControlGuid { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components!= null)) { components.Dispose(); } base.Dispose(disposing); } #region Component Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.chkUppercase = new System.Windows.Forms.CheckBox(); this.lblUppercase = new System.Windows.Forms.Label(); this.formatComboBox = new System.Windows.Forms.ComboBox(); this.lblFormat = new System.Windows.Forms.Label(); this.SuspendLayout(); // // chkUppercase // this.chkUppercase.AutoSize = true; this.chkUppercase.Checked = true; this.chkUppercase.CheckState = System.Windows.Forms.CheckState.Checked; this.chkUppercase.Location = new System.Drawing.Point(108, 2); this.chkUppercase.Name = "chkUppercase"; this.chkUppercase.Size = new System.Drawing.Size(15, 14); this.chkUppercase.TabIndex = 11; this.chkUppercase.UseVisualStyleBackColor = true; // // lblUppercase // this.lblUppercase.AutoSize = true; this.lblUppercase.Location = new System.Drawing.Point(4, 2); this.lblUppercase.Name = "lblUppercase"; this.lblUppercase.Size = new System.Drawing.Size(59, 13); this.lblUppercase.TabIndex = 10; this.lblUppercase.Text = "Uppercase"; // // formatComboBox // this.formatComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.formatComboBox.FormattingEnabled = true; this.formatComboBox.Location = new System.Drawing.Point(193, 0); this.formatComboBox.Name = "formatComboBox"; this.formatComboBox.Size = new System.Drawing.Size(33, 21); this.formatComboBox.TabIndex = 12; // // lblFormat // this.lblFormat.AutoSize = true; this.lblFormat.Location = new System.Drawing.Point(143, 3); this.lblFormat.Name = "lblFormat"; this.lblFormat.Size = new System.Drawing.Size(39, 13); this.lblFormat.TabIndex = 13; this.lblFormat.Text = "Format"; // // UserControlGuid // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.lblFormat); this.Controls.Add(this.formatComboBox); this.Controls.Add(this.chkUppercase); this.Controls.Add(this.lblUppercase); this.Name = "UserControlGUID"; this.Size = new System.Drawing.Size(350, 47); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.CheckBox chkUppercase; private System.Windows.Forms.Label lblUppercase; private System.Windows.Forms.ComboBox formatComboBox; private System.Windows.Forms.Label lblFormat; } } ======================= File: src/RandomDataGenerator.Gui/Util/StringUtils.cs ======================= <filename>src/RandomDataGenerator.Gui/Util/StringUtils.cs  namespace RandomDataGenerator.Gui.Util { public static class StringUtils { public static string MakeSafeSQL(object value) { if (value == null) { return "NULL"; } string strValue = value.ToString(); return!string.IsNullOrEmpty(strValue)? strValue.Replace("'", "''") : string.Empty; } public static string AddSQLQuotes(object value) { if (value == null) { return AddSQLQuotes("NULL"); } return $"'{MakeSafeSQL(value)}'"; } } } ======================= File: src/RandomDataGenerator/Randomizers/RandomizerCity.cs ======================= using RandomDataGenerator.Data; using RandomDataGenerator.Extensions; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Generators; namespace RandomDataGenerator.Randomizers { public class RandomizerCity : RandomizerAbstract<FieldOptionsCity>, IRandomizerString { private readonly RandomStringFromListGenerator _generator; public RandomizerCity(FieldOptionsCity options) : base(options) { _generator = new RandomStringFromListGenerator(ListData.Instance.CityNames); } public string Generate() { return IsNull()? null : _generator.Generate(); } public string Generate(bool upperCase) { return Generate().ToCasedInvariant(upperCase); } } } ======================= File: src/RandomDataGenerator/Generators/RandomStringsFromListGenerator.cs ======================= using System.Collections.Generic; namespace RandomDataGenerator.Generators { internal class RandomStringsFromListGenerator : RandomItemsFromListGenerator<string> { public RandomStringsFromListGenerator(IEnumerable<string> list, int? seed = null) : base(seed, list) { } } } ======================= File: src/RandomDataGenerator/FieldOptions/IFieldOptionsNumber.cs ======================= <filename>src/RandomDataGenerator/FieldOptions/IFieldOptionsNumber.cs namespace RandomDataGenerator.FieldOptions { public interface IFieldOptionsNumber<out T> where T : struct { } } ======================= File: src/RandomDataGenerator.Gui/Extensions/ControlExtensions.cs ======================= using System.Linq; using System.Windows.Forms; namespace RandomDataGenerator.Gui.Extensions { public static class ControlExtensions { public static T FindControl<T>(this Control parent) where T : class { return parent.Controls.OfType<T>().FirstOrDefault(); } } } ======================= File: src/RandomDataGenerator/Generators/RandomValueGenerator.cs ======================= <reponame>brunotarghetta/RandomDataGenerator using System; namespace RandomDataGenerator.Generators { /// <summary> /// Copyright : http://www.cambiaresearch.com/articles/13/csharp-randomprovider-class /// /// RandomProvider. Provides random numbers of all data types /// in specified ranges. It also contains a couple of methods /// from Normally (Gaussian) distributed random numbers and /// Exponentially distributed random numbers. /// </summary> internal class RandomValueGenerator { private const double Tolerance = double.Epsilon; private Random _rnf; private double _storedUniformDeviate; private bool _storedUniformDeviateIsGood; public static Type[] SupportedTypes { get; } = { typeof(bool), typeof(byte), typeof(short), typeof(int), typeof(long), typeof(float), typeof(double), typeof(long), typeof(DateTime), typeof(TimeSpan) }; #region -- Construction/Initialization -- public RandomValueGenerator(int seed) { Reset(seed); } public void Reset(int seed) { _rnf = new Random(seed); } #endregion #region -- Uniform Deviates -- /// <summary> /// Returns double in the range [0, 1) /// </summary> public double Next() { return _rnf.NextDouble(); } /// <summary> /// Returns true or false randomly. /// </summary> public bool NextBoolean() { return _rnf.Next(0, 2)!= 0; } /// <summary> /// Returns double in the range [0, 1) /// </summary> public double NextDouble() { return _rnf.NextDouble(); } /// <summary> /// Generates an array of bytes with random numbers. /// </summary> /// <param name="min">The minimum number of bytes</param> /// <param name="max">The maximum number of bytes</param> /// <returns>Random byte array</returns> public byte[] NextBytes(int min, int max) { int arrayLength = Next(min, max); byte[] bytes = new byte[arrayLength]; _rnf.NextBytes(bytes); return bytes; } /// <summary> /// Return a random T in the range [min, max] /// </summary> /// <typeparam name="T">Generic type</typeparam> /// <param name="min">The minimum value</param> /// <param name="max">The maximum value</param> /// <returns>Random T</returns> public T Next<T>(T min, T max) { if (typeof(T) == typeof(bool)) { return (T)(object)NextBoolean(); } if (typeof(T) == typeof(byte)) { return (T)(object)Next((byte)(object)min, (byte)(object)max); } if (typeof(T) == typeof(short)) { return (T)(object)Next((short)(object)min, (short)(object)max); } if (typeof(T) == typeof(int)) { return (T)(object)Next((int)(object)min, (int)(object)max); } if (typeof(T) == typeof(long)) { return (T)(object)Next((long)(object)min, (long)(object)max); } if (typeof(T) == typeof(float)) { return (T)(object)Next((float)(object)min, (float)(object)max); } if (typeof(T) == typeof(double)) { return (T)(object)Next((double)(object)min, (double)(object)max); } if (typeof(T) == typeof(DateTime)) { return (T)(object)Next((DateTime)(object)min, (DateTime)(object)max); } if (typeof(T) == typeof(TimeSpan)) { return (T)(object)Next((TimeSpan)(object)min, (TimeSpan)(object)max); } throw new NotSupportedException($"The type '{typeof(T)}' cannot be used."); } /// <summary> /// Returns byte in the range [min, max) /// </summary> public byte Next(byte min, byte max) { if (max <= min) { throw new ArgumentException("Max must be greater than min."); } double rn = (max * 1.0 - min * 1.0) * _rnf.NextDouble() + min * 1.0; return Convert.ToByte(rn); } /// <summary> /// Returns Int16 in the range [min, max) /// </summary> public short Next(short min, short max) { if (max <= min) { throw new ArgumentException("Max must be greater than min."); } double rn = (max * 1.0 - min * 1.0) * _rnf.NextDouble() + min * 1.0; return Convert.ToInt16(rn); } /// <summary> /// Returns Int32 in the range [min, max) /// </summary> public int Next(int min, int max) { return _rnf.Next(min, max); } /// <summary> /// Returns Int64 in the range [min, max) /// </summary> public long Next(long min, long max) { if (max <= min) { throw new ArgumentException("Max must be greater than min."); } double rn = (max * 1.0 - min * 1.0) * _rnf.NextDouble() + min * 1.0; return Convert.ToInt64(rn); } /// <summary> /// Returns float (Single) in the range [min, max) /// </summary> public float Next(float min, float max) { if (max <= min) { throw new ArgumentException("Max must be greater than min."); } double rn = (max * 1.0 - min * 1.0) * _rnf.NextDouble() + min * 1.0; return Convert.ToSingle(rn); } /// <summary> /// Returns double in the range [min, max) /// </summary> public double Next(double min, double max) { if (max <= min) { throw new ArgumentException("Max must be greater than min."); } double rn = (max - min) * _rnf.NextDouble() + min; return rn; } /// <summary> /// Returns DateTime in the range [min, max) /// </summary> public DateTime Next(DateTime min, DateTime max) { if (max <= min) { throw new ArgumentException("Max must be greater than min."); } long minTicks = min.Ticks; long maxTicks = max.Ticks; double rn = (Convert.ToDouble(maxTicks) - Convert.ToDouble(minTicks)) * _rnf.NextDouble() + Convert.ToDouble(minTicks); return new DateTime(Convert.ToInt64(rn)); } /// <summary> /// Returns TimeSpan in the range [min, max) /// </summary> public TimeSpan Next(TimeSpan min, TimeSpan max) { if (max <= min) { throw new ArgumentException("Max must be greater than min."); } long minTicks = min.Ticks; long maxTicks = max.Ticks; double rn = (Convert.ToDouble(maxTicks) - Convert.ToDouble(minTicks)) * _rnf.NextDouble() + Convert.ToDouble(minTicks); return new TimeSpan(Convert.ToInt64(rn)); } /// <summary> /// Returns double in the range [min, max) /// </summary> public double NextUniform() { return Next(); } /// <summary> /// Returns a uniformly random integer representing one of the values /// in the enum. /// </summary> public int NextEnum(Type enumType) { var values = (int[])Enum.GetValues(enumType); int randomIndex = Next(0, values.Length); return values[randomIndex]; } #endregion #region -- Exponential Deviates -- /// <summary> /// Returns an exponentially distributed, positive, random deviate of unit mean. /// </summary> public double NextExponential() { double dum = 0.0; while (Math.Abs(dum) < Tolerance) { dum = NextUniform(); } return -1.0 * Math.Log(dum, Math.E); } #endregion #region -- Normal Deviates -- /// <summary> /// Returns a normally distributed deviate with zero mean and unit /// variance. /// </summary> public double NextNormal() { // based on algorithm from Numerical Recipes if (_storedUniformDeviateIsGood) { _storedUniformDeviateIsGood = false; return _storedUniformDeviate; } double rsq = 0.0; double v1 = 0.0, v2 = 0.0; while (rsq >= 1.0 || Math.Abs(rsq) < Tolerance) { v1 = 2.0 * Next() - 1.0; v2 = 2.0 * Next() - 1.0; rsq = v1 * v1 + v2 * v2; } double fac = Math.Sqrt(-2.0 * Math.Log(rsq, Math.E) / rsq); _storedUniformDeviate = v1 * fac; _storedUniformDeviateIsGood = true; return v2 * fac; } #endregion } } ======================= File: src/RandomDataGenerator.Gui/UserControls/UserControlExample.cs ======================= <filename>src/RandomDataGenerator.Gui/UserControls/UserControlExample.cs using System.Windows.Forms; namespace RandomDataGenerator.Gui.UserControls { public partial class UserControlExample : UserControl { public UserControlExample() { InitializeComponent(); } } } ======================= File: src/RandomDataGenerator/FieldOptions/FieldOptionsGuid.cs ======================= <reponame>brunotarghetta/RandomDataGenerator  namespace RandomDataGenerator.FieldOptions { public class FieldOptionsGuid : FieldOptionsAbstract, IFieldOptionsGuid { public bool Uppercase { get; set; } = true; public string Format { get; set; } = "D"; } } ======================= File: src/RandomDataGenerator/Generators/RandomItemsFromListGenerator.cs ======================= using System; using System.Collections.Generic; using System.Linq; namespace RandomDataGenerator.Generators { internal class RandomItemsFromListGenerator<T> { private readonly RandomValueGenerator _randomValueGenerator; private readonly T[] _list; public RandomItemsFromListGenerator(int? seed, IEnumerable<T> list, Func<T, bool> predicate = null) { _list = predicate == null? list.ToArray() : list.Where(predicate).ToArray(); _randomValueGenerator = new RandomValueGenerator(seed?? Environment.TickCount); } public List<T> Generate(int count) { var list = new List<T>(count); for (int i = 0; i < count; i++) { int index = _randomValueGenerator.Next(0, _list.Length - 1); list.Add(_list[index]); } return list; } } } ======================= File: src/RandomDataGenerator/Data/TheNaughtyStrings.cs ======================= // Copied from https://raw.githubusercontent.com/SimonCropp/NaughtyStrings/master/src/NaughtyStrings/TheNaughtyStrings.cs using System.Collections.Generic; namespace RandomDataGenerator.Data { public static class TheNaughtyStrings { /// <summary> /// All naughty strings. /// </summary> public static IList<string> All = new List<string> { "undefined", "undef", "null", "NULL", "(null)", "nil", "NIL", "true", "false", "True", "False", "TRUE", "FALSE", "None", "hasOwnProperty", "then", "constructor", "\\", "\\\\", "0", "1", "1.00", "$1.00", "1/2", "1E2", "1E02", "1E+02", "-1", "-1.00", "-$1.00", "-1/2", "-1E2", "-1E02", "-1E+02", "1/0", "0/0", "-2147483648/-1", "-9223372036854775808/-1", "-0", "-0.0", "+0", "+0.0", "0.00", "0..0", ".", "0.0.0", "0,00", "0,,0", ",", "0,0,0", "0.0/0", "1.0/0.0", "0.0/0.0", "1,0/0,0", "0,0/0,0", "--1", "-", "-.", "-,", "999999999999999999999999999999999999999999999999999999999999999999999999999999999" + "999999999999999", "NaN", "Infinity", "-Infinity", "INF", "1#INF", "-1#IND", "1#QNAN", "1#SNAN", "1#IND", "0x0", "0xffffffff", "0xffffffffffffffff", "0xabad1dea", "123456789012345678901234567890123456789", "1,000.00", "1 000.00", "1\'000.00", "1,000,000.00", "1 000 000.00", "1\'000\'000.00", "1.000,00", "1 000,00", "1\'000,00", "1.000.000,00", "1 000 000,00", "1\'000\'000,00", "01000", "08", "09", "2.2250738585072011e-308", ",./;\'[]\\-=", "<>?:\"{}|_+", "!@#$%^&*()`~", "", "€‚ƒ„†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ", @"\t             ​\u2028\u2029   ", @"­؀؁؂؃؄؅؜۝܏᠎​‌‍‎‏‪‫‬‭‮⁠⁡⁢⁣⁤⁦⁧⁨⁩𑂽𛲠𛲡𛲢𛲣𝅳𝅴𝅵𝅶𝅷𝅸𝅹𝅺󠀁󠀠󠀡󠀢󠀣󠀤󠀥󠀦󠀧󠀨󠀩󠀪󠀫󠀬󠀭󠀮󠀯󠀰󠀱󠀲󠀳󠀴󠀵󠀶󠀷󠀸󠀹󠀺󠀻󠀼󠀽󠀾󠀿󠁀󠁁󠁂󠁃󠁄󠁅󠁆󠁇󠁈󠁉󠁊󠁋󠁌󠁍󠁎󠁏󠁐󠁑󠁒󠁓󠁔󠁕󠁖󠁗󠁘󠁙󠁚󠁛󠁜󠁝󠁞󠁟󠁠󠁡󠁢󠁣󠁤󠁥󠁦󠁧󠁨󠁩󠁪󠁫󠁬󠁭󠁮󠁯󠁰󠁱󠁲󠁳󠁴󠁵󠁶󠁷󠁸󠁹󠁺󠁻󠁼󠁽󠁾󠁿", "", "￾", "Ω≈ç√∫˜µ≤≥÷", "åß∂ƒ©˙∆˚¬…æ", "œ∑´®†¥¨ˆøπ“‘", "¡™£¢∞§¶•ªº–≠", "¸˛Ç◊ı˜Â¯˘¿", "ÅÍÎÏ˝ÓÔÒÚÆ☃", "Œ„´‰ˇÁ¨ˆØ∏”’", "`⁄€‹›fifl‡°·‚—±", "⅛⅜⅝⅞", "ЁЂЃЄЅІЇЈЉЊЋЌЍЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя", "٠١٢٣٤٥٦٧٨٩", "⁰⁴⁵", "₀₁₂", "⁰⁴⁵₀₁₂", @"ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็ ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็ ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็", "\'", "\"", "\'\'", "\"\"", "\'\"\'", "\"\'\'\'\'\"\'\"", "\"\'\"\'\"\'\'\'\'\"", "<foo val=“bar” />", "<foo val=“bar” />", "<foo val=”bar“ />", "<foo val=`bar\' />", "田中さんにあげて下さい", "パーティーへ行かないか", "和製漢語", "部落格", "사회과학원 어학연구소", "찦차를 타고 온 펲시맨과 쑛다리 똠방각하", "社會科學院語學研究所", "울란바토르", "𠜎𠜱𠝹𠱓𠱸𠲖𠳏", "𐐜 𐐔𐐇𐐝𐐀𐐡𐐇𐐓 𐐙𐐊𐐡𐐝𐐓/𐐝𐐇𐐗𐐊𐐤𐐔 𐐒𐐋𐐗 𐐒𐐌 𐐜 𐐡𐐀𐐖𐐇𐐤𐐓𐐝 𐐱𐑂 𐑄 𐐔" + "𐐇𐐝𐐀𐐡𐐇𐐓 𐐏𐐆𐐅𐐤𐐆𐐚𐐊𐐡𐐝𐐆𐐓𐐆", "表", "ポ", "あ", "A", "鷗", "Œ", "é", "B", "逍", "Ü", "ß", "ª", "ą", "ñ", "丂", "㐀", "𠀀", "Ⱥ", "Ⱦ", "ヽ༼ຈل͜ຈ༽ノ ヽ༼ຈل͜ຈ༽ノ", "(。◕ ∀ ◕。)", "`ィ(´∀`∩", "__ロ(,_,*)", "・( ̄∀ ̄)・:*:", "゚・✿ヾ╲(。◕‿◕。)╱✿・゚", ",。・:*:・゜’( ☻ ω ☻ )。・:*:・゜’", "(╯°□°)╯︵ ┻━┻)", "(ノಥ益ಥ)ノ ┻━┻", "┬─┬ノ( º _ ºノ)", "( ͡° ͜ʖ ͡°)", "¯\\_(ツ)_/¯", "😍", "👩🏽", "👨‍🦰 👨🏿‍🦰 👨‍🦱 👨🏿‍🦱 🦹🏿‍♂️", "👾 🙇 💁 🙅 🙆 🙋 🙎 🙍", "🐵 🙈 🙉 🙊", "❤️ 💔 💌 💕 💞 💓 💗 💖 💘 💝 💟 💜 💛 💚 💙", "✋🏿 💪🏿 👐🏿 🙌🏿 👏🏿 🙏🏿", "🚾 🆒 🆓 🆕 🆖 🆗 🆙 🏧", "0️⃣ 1️⃣ 2️⃣ 3️⃣ 4️⃣ 5️⃣ 6️⃣ 7️⃣ 8️⃣ 9️⃣ 🔟", "🇺🇸🇷🇺🇸 🇦🇫🇦🇲🇸", "🇺🇸🇷🇺🇸🇦🇫🇦🇲", "🇺🇸🇷🇺🇸🇦", "123", "١٢٣", "ثم نفس سقطت وبالتحديد،, جزيرتي باستخدام أن دنو. إذ هنا؟ الستار وتنصيب كان. أهّل ا" + "يطاليا، بريطانيا-فرنسا قد أخذ. سليمان، إتفاقية بين ما, يذكر الحدود أي بعد, معامل" + "ة بولندا، الإطلاق عل إيو.", "בְּרֵאשִׁית, בָּרָא אֱלֹהִים, אֵת הַשָּׁמַיִם, וְאֵת הָאָרֶץ", "הָיְתָהtestالصفحات التّحول", "﷽", "ﷺ", "مُنَاقَشَةُ سُبُلِ اِسْتِخْدَامِ اللُّغَةِ فِي النُّظُمِ الْقَائِمَةِ وَفِيم يَخُ" + "صَّ التَّطْبِيقَاتُ الْحاسُوبِيَّةُ،", "الكل في المجمو عة (5)", "᚛ᚄᚓᚐᚋᚒᚄ ᚑᚄᚂᚑᚏᚅ᚜", "᚛                 ᚜", "‪‪test‪", "‫test‫", "\u2029test\u2029", "test⁠test‫", "⁦test⁧", "Ṱ̺̺̕o͞ ̷i̲̬͇̪͙n̝̗͕v̟̜̘̦͟o̶̙̰̠kè͚̮̺̪̹̱̤ ̖t̝͕̳̣̻̪͞h̼͓̲̦̳̘̲e͇̣̰̦̬͎ ̢̼̻̱̘h͚͎͙̜̣̲ͅi̦̲̣" + "̰̤v̻͍e̺̭̳̪̰-m̢iͅn̖̺̞̲̯̰d̵̼̟͙̩̼̘̳ ̞̥̱̳̭r̛̗̘e͙p͠r̼̞̻̭̗e̺̠̣͟s̘͇̳͍̝͉e͉̥̯̞̲͚̬͜ǹ̬͎͎̟̖͇" + "̤t͍̬̤͓̼̭͘ͅi̪̱n͠g̴͉ ͏͉ͅc̬̟h͡a̫̻̯͘o̫̟̖͍̙̝͉s̗̦̲.̨̹͈̣", "̡͓̞ͅI̗̘̦͝n͇͇͙v̮̫ok̲̫̙͈i̖͙̭̹̠̞n̡̻̮̣̺g̲͈͙̭͙̬͎ ̰t͔̦h̞̲e̢̤ ͍̬̲͖f̴̘͕̣è͖ẹ̥̩l͖͔͚i͓͚̦͠n͖͍" + "̗͓̳̮g͍ ̨o͚̪͡f̘̣̬ ̖̘͖̟͙̮c҉͔̫͖͓͇͖ͅh̵̤̣͚͔á̗̼͕ͅo̼̣̥s̱͈̺̖̦̻͢.̛̖̞̠̫̰", "̗̺͖̹̯͓Ṯ̤͍̥͇͈h̲́e͏͓̼̗̙̼̣͔ ͇̜̱̠͓͍ͅN͕͠e̗̱z̘̝̜̺͙p̤̺̹͍̯͚e̠̻̠͜r̨̤͍̺̖͔̖̖d̠̟̭̬̝͟i̦͖̩͓͔̤a̠" + "̗̬͉̙n͚͜ ̻̞̰͚ͅh̵͉i̳̞v̢͇ḙ͎͟-҉̭̩̼͔m̤̭̫i͕͇̝̦n̗͙ḍ̟ ̯̲͕͞ǫ̟̯̰̲͙̻̝f ̪̰̰̗̖̭̘͘c̦͍̲̞͍̩̙ḥ͚a̮" + "͎̟̙͜ơ̩̹͎s̤.̝̝ ҉Z̡̖̜͖̰̣͉̜a͖̰͙̬͡l̲̫̳͍̩g̡̟̼̱͚̞̬ͅo̗͜.̟", "̦H̬̤̗̤͝e͜ ̜̥̝̻͍̟́w̕h̖̯͓o̝͙̖͎̱̮ ҉̺̙̞̟͈W̷̼̭a̺̪͍į͈͕̭͙̯̜t̶̼̮s̘͙͖̕ ̠̫̠B̻͍͙͉̳ͅe̵h̵̬͇̫͙i" + "̹͓̳̳̮͎̫̕n͟d̴̪̜̖ ̰͉̩͇͙̲͞ͅT͖̼͓̪͢h͏͓̮̻e̬̝̟ͅ ̤̹̝W͙̞̝͔͇͝ͅa͏͓͔̹̼̣l̴͔̰̤̟͔ḽ̫.͕", "Z̮̞̠͙͔ͅḀ̗̞͈̻̗Ḷ͙͎̯̹̞͓G̻O̭̗̮", "˙ɐnbᴉlɐ ɐuƃɐɯ ǝɹolop ʇǝ ǝɹoqɐl ʇn ʇunpᴉpᴉɔuᴉ ɹodɯǝʇ poɯsnᴉǝ op pǝs \'ʇᴉlǝ ƃuᴉɔsᴉdᴉ" + "pɐ ɹnʇǝʇɔǝsuoɔ \'ʇǝɯɐ ʇᴉs ɹolop ɯnsdᴉ ɯǝɹo˥", "00˙Ɩ$-", "The quick brown fox jumps over the lazy dog", "𝐓𝐡𝐞 𝐪𝐮𝐢𝐜𝐤 𝐛𝐫𝐨𝐰𝐧 𝐟𝐨𝐱 𝐣𝐮𝐦𝐩𝐬 𝐨𝐯𝐞𝐫 𝐭𝐡𝐞 𝐥𝐚𝐳𝐲 𝐝𝐨𝐠", "𝕿𝖍𝖊 𝖖𝖚𝖎𝖈𝖐 𝖇𝖗𝖔𝖜𝖓 𝖋𝖔𝖝 𝖏𝖚𝖒𝖕𝖘 𝖔𝖛𝖊𝖗 𝖙𝖍𝖊 𝖑𝖆𝖟𝖞 𝖉𝖔𝖌", "𝑻𝒉𝒆 𝒒𝒖𝒊𝒄𝒌 𝒃𝒓𝒐𝒘𝒏 𝒇𝒐𝒙 𝒋𝒖𝒎𝒑𝒔 𝒐𝒗𝒆𝒓 𝒕𝒉𝒆 𝒍𝒂𝒛𝒚 𝒅𝒐𝒈", "𝓣𝓱𝓮 𝓺𝓾𝓲𝓬𝓴 𝓫𝓻𝓸𝔀𝓷 𝓯𝓸𝔁 𝓳𝓾𝓶𝓹𝓼 𝓸𝓿𝓮𝓻 𝓽𝓱𝓮 𝓵𝓪𝔃𝔂 𝓭𝓸𝓰", "𝕋𝕙𝕖 𝕢𝕦𝕚𝕔𝕜 𝕓𝕣𝕠𝕨𝕟 𝕗𝕠𝕩 𝕛𝕦𝕞𝕡𝕤 𝕠𝕧𝕖𝕣 𝕥𝕙𝕖 𝕝𝕒𝕫𝕪 𝕕𝕠𝕘", "𝚃𝚑𝚎 𝚚𝚞𝚒𝚌𝚔 𝚋𝚛𝚘𝚠𝚗 𝚏𝚘𝚡 𝚓𝚞𝚖𝚙𝚜 𝚘𝚟𝚎𝚛 𝚝𝚑𝚎 𝚕𝚊𝚣𝚢 𝚍𝚘𝚐", "⒯⒣⒠ ⒬⒰⒤⒞⒦ ⒝⒭⒪⒲⒩ ⒡⒪⒳ ⒥⒰⒨⒫⒮ ⒪⒱⒠⒭ ⒯⒣⒠ ⒧⒜⒵⒴ ⒟⒪⒢", "<script>alert(123)</script>", "&lt;script&gt;alert(&#39;123&#39;);&lt;/script&gt;", "<img src=x onerror=alert(123) />", "<svg><script>123<1>alert(123)</script>", "\"><script>alert(123)</script>", "\'><script>alert(123)</script>", "><script>alert(123)</script>", "</script><script>alert(123)</script>", "< / script >< script >alert(123)< / script >", " onfocus=JaVaSCript:alert(123) autofocus", "\" onfocus=JaVaSCript:alert(123) autofocus", "\' onfocus=JaVaSCript:alert(123) autofocus", "<script>alert(123)</script>", "<sc<script>ript>alert(123)</sc</script>ript>", "--><script>alert(123)</script>", "\";alert(123);t=\"", "\';alert(123);t=\'", "JavaSCript:alert(123)", ";alert(123);", "src=JaVaSCript:prompt(132)", "\"><script>alert(123);</script x=\"", "\'><script>alert(123);</script x=\'", "><script>alert(123);</script x=", "\" autofocus onkeyup=\"javascript:alert(123)", "\' autofocus onkeyup=\'javascript:alert(123)", "<script\\x20type=\"text/javascript\">javascript:alert(1);</script>", "<script\\x3Etype=\"text/javascript\">javascript:alert(1);</script>", "<script\\x0Dtype=\"text/javascript\">javascript:alert(1);</script>", "<script\\x09type=\"text/javascript\">javascript:alert(1);</script>", "<script\\x0Ctype=\"text/javascript\">javascript:alert(1);</script>", "<script\\x2Ftype=\"text/javascript\">javascript:alert(1);</script>", "<script\\x0Atype=\"text/javascript\">javascript:alert(1);</script>", "\'`\"><\\x3Cscript>javascript:alert(1)</script>", "\'`\"><\\x00script>javascript:alert(1)</script>", "ABC<div style=\"x\\x3Aexpression(javascript:alert(1)\">DEF", "ABC<div style=\"x:expression\\x5C(javascript:alert(1)\">DEF", "ABC<div style=\"x:expression\\x00(javascript:alert(1)\">DEF", "ABC<div style=\"x:exp\\x00ression(javascript:alert(1)\">DEF", "ABC<div style=\"x:exp\\x5Cression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\x0Aexpression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\x09expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE3\\x80\\x80expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x84expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xC2\\xA0expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x80expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x8Aexpression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\x0Dexpression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\x0Cexpression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x87expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xEF\\xBB\\xBFexpression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\x20expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x88expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\x00expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x8Bexpression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x86expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x85expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x82expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\x0Bexpression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x81expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x83expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x89expression(javascript:alert(1)\">DEF", "<a href=\"\\x0Bjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x0Fjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xC2\\xA0javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x05javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE1\\xA0\\x8Ejavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x18javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x11javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\x88javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\x89javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\x80javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x17javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x03javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x0Ejavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x1Ajavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x00javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x10javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\x82javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x20javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x13javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x09javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\x8Ajavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x14javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x19javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\xAFjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x1Fjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\x81javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x1Djavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\x87javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x07javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE1\\x9A\\x80javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\x83javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x04javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x01javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x08javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\x84javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\x86javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE3\\x80\\x80javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x12javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x0Djavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x0Ajavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x0Cjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x15javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\xA8javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x16javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x02javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x1Bjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x06javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\xA9javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\x85javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x1Ejavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x81\\x9Fjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x1Cjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"javascript\\x00:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"javascript\\x3A:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"javascript\\x09:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"javascript\\x0D:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"javascript\\x0A:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "`\"\'><img src=xxx:x \\x0Aonerror=javascript:alert(1)>", "`\"\'><img src=xxx:x \\x22onerror=javascript:alert(1)>", "`\"\'><img src=xxx:x \\x0Bonerror=javascript:alert(1)>", "`\"\'><img src=xxx:x \\x0Donerror=javascript:alert(1)>", "`\"\'><img src=xxx:x \\x2Fonerror=javascript:alert(1)>", "`\"\'><img src=xxx:x \\x09onerror=javascript:alert(1)>", "`\"\'><img src=xxx:x \\x0Conerror=javascript:alert(1)>", "`\"\'><img src=xxx:x \\x00onerror=javascript:alert(1)>", "`\"\'><img src=xxx:x \\x27onerror=javascript:alert(1)>", "`\"\'><img src=xxx:x \\x20onerror=javascript:alert(1)>", "\"`\'><script>\\x3Bjavascript:alert(1)</script>", "\"`\'><script>\\x0Djavascript:alert(1)</script>", "\"`\'><script>\\xEF\\xBB\\xBFjavascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\x81javascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\x84javascript:alert(1)</script>", "\"`\'><script>\\xE3\\x80\\x80javascript:alert(1)</script>", "\"`\'><script>\\x09javascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\x89javascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\x85javascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\x88javascript:alert(1)</script>", "\"`\'><script>\\x00javascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\xA8javascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\x8Ajavascript:alert(1)</script>", "\"`\'><script>\\xE1\\x9A\\x80javascript:alert(1)</script>", "\"`\'><script>\\x0Cjavascript:alert(1)</script>", "\"`\'><script>\\x2Bjavascript:alert(1)</script>", "\"`\'><script>\\xF0\\x90\\x96\\x9Ajavascript:alert(1)</script>", "\"`\'><script>-javascript:alert(1)</script>", "\"`\'><script>\\x0Ajavascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\xAFjavascript:alert(1)</script>", "\"`\'><script>\\x7Ejavascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\x87javascript:alert(1)</script>", "\"`\'><script>\\xE2\\x81\\x9Fjavascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\xA9javascript:alert(1)</script>", "\"`\'><script>\\xC2\\x85javascript:alert(1)</script>", "\"`\'><script>\\xEF\\xBF\\xAEjavascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\x83javascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\x8Bjavascript:alert(1)</script>", "\"`\'><script>\\xEF\\xBF\\xBEjavascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\x80javascript:alert(1)</script>", "\"`\'><script>\\x21javascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\x82javascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\x86javascript:alert(1)</script>", "\"`\'><script>\\xE1\\xA0\\x8Ejavascript:alert(1)</script>", "\"`\'><script>\\x0Bjavascript:alert(1)</script>", "\"`\'><script>\\x20javascript:alert(1)</script>", "\"`\'><script>\\xC2\\xA0javascript:alert(1)</script>", "<img \\x00src=x onerror=\"alert(1)\">", "<img \\x47src=x onerror=\"javascript:alert(1)\">", "<img \\x11src=x onerror=\"javascript:alert(1)\">", "<img \\x12src=x onerror=\"javascript:alert(1)\">", "<img\\x47src=x onerror=\"javascript:alert(1)\">", "<img\\x10src=x onerror=\"javascript:alert(1)\">", "<img\\x13src=x onerror=\"javascript:alert(1)\">", "<img\\x32src=x onerror=\"javascript:alert(1)\">", "<img\\x47src=x onerror=\"javascript:alert(1)\">", "<img\\x11src=x onerror=\"javascript:alert(1)\">", "<img \\x47src=x onerror=\"javascript:alert(1)\">", "<img \\x34src=x onerror=\"javascript:alert(1)\">", "<img \\x39src=x onerror=\"javascript:alert(1)\">", "<img \\x00src=x onerror=\"javascript:alert(1)\">", "<img src\\x09=x onerror=\"javascript:alert(1)\">", "<img src\\x10=x onerror=\"javascript:alert(1)\">", "<img src\\x13=x onerror=\"javascript:alert(1)\">", "<img src\\x32=x onerror=\"javascript:alert(1)\">", "<img src\\x12=x onerror=\"javascript:alert(1)\">", "<img src\\x11=x onerror=\"javascript:alert(1)\">", "<img src\\x00=x onerror=\"javascript:alert(1)\">", "<img src\\x47=x onerror=\"javascript:alert(1)\">", "<img src=x\\x09onerror=\"javascript:alert(1)\">", "<img src=x\\x10onerror=\"javascript:alert(1)\">", "<img src=x\\x11onerror=\"javascript:alert(1)\">", "<img src=x\\x12onerror=\"javascript:alert(1)\">", "<img src=x\\x13onerror=\"javascript:alert(1)\">", "<img[a][b][c]src[d]=x[e]onerror=[f]\"alert(1)\">", "<img src=x onerror=\\x09\"javascript:alert(1)\">", "<img src=x onerror=\\x10\"javascript:alert(1)\">", "<img src=x onerror=\\x11\"javascript:alert(1)\">", "<img src=x onerror=\\x12\"javascript:alert(1)\">", "<img src=x onerror=\\x32\"javascript:alert(1)\">", "<img src=x onerror=\\x00\"javascript:alert(1)\">", "<a href=java&#1&#2&#3&#4&#5&#6&#7&#8&#11&#12script:javascript:alert(1)>XXX</a>", "<img src=\"x` `<script>javascript:alert(1)</script>\"` `>", "<img src onerror /\" \'\"= alt=javascript:alert(1)//\">", "<title onpropertychange=javascript:alert(1)></title><title title=>", "<a href=http://foo.bar/#x=`y></a><img alt=\"`><img src=x:x onerror=javascript:aler" + "t(1)></a>\">", "<!--[if]><script>javascript:alert(1)</script -->", "<!--[if<img src=x onerror=javascript:alert(1)//]> -->", "<script src=\"/\\%(jscript)s\"></script>", "<script src=\"\\\\%(jscript)s\"></script>", "<IMG \"\"\"><SCRIPT>alert(\"XSS\")</SCRIPT>\">", "<IMG SRC=javascript:alert(String.fromCharCode(88,83,83))>", "<IMG SRC=# onmouseover=\"alert(\'xxs\')\">", "<IMG SRC= onmouseover=\"alert(\'xxs\')\">", "<IMG onmouseover=\"alert(\'xxs\')\">", "<IMG SRC=&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;&#97;&#108" + ";&#101;&#114;&#116;&#40;&#39;&#88;&#83;&#83;&#39;&#41;>", "<IMG SRC=&#0000106&#0000097&#0000118&#0000097&#0000115&#0000099&#0000114&#0000105" + "&#0000112&#0000116&#0000058&#0000097&#0000108&#0000101&#0000114&#0000116&#000004" + "0&#0000039&#0000088&#0000083&#0000083&#0000039&#0000041>", "<IMG SRC=&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A&#x61&#x6C&#x65&#" + "x72&#x74&#x28&#x27&#x58&#x53&#x53&#x27&#x29>", "<IMG SRC=\"jav ascript:alert(\'XSS\');\">", "<IMG SRC=\"jav&#x09;ascript:alert(\'XSS\');\">", "<IMG SRC=\"jav&#x0A;ascript:alert(\'XSS\');\">", "<IMG SRC=\"jav&#x0D;ascript:alert(\'XSS\');\">", "perl -e \'print \"<IMG SRC=java\\0script:alert(\\\"XSS\\\")>\";\' > out", "<IMG SRC=\" &#14; javascript:alert(\'XSS\');\">", "<SCRIPT/XSS SRC=\"http://ha.ckers.org/xss.js\"></SCRIPT>", "<BODY onload!#$%&()*~+-_.,:;?@[/|\\]^`=alert(\"XSS\")>", "<SCRIPT/SRC=\"http://ha.ckers.org/xss.js\"></SCRIPT>", "<<SCRIPT>alert(\"XSS\");//<</SCRIPT>", "<SCRIPT SRC=http://ha.ckers.org/xss.js?< B >", "<SCRIPT SRC=//ha.ckers.org/.j>", "<IMG SRC=\"javascript:alert(\'XSS\')\"", "<iframe src=http://ha.ckers.org/scriptlet.html <", "\\\";alert(\'XSS\');//", "<u oncopy=alert()> Copy me</u>", "<i onwheel=alert(1)> Scroll over me </i>", "<plaintext>", "http://a/%%30%30", "</textarea><script>alert(123)</script>", "1;DROP TABLE users", "1\'; DROP TABLE users-- 1", "\' OR 1=1 -- 1", "\' OR \'1\'=\'1", " ", "%", "_", "-", "--", "--version", "--help", "$USER", "/dev/null; touch /tmp/blns.fail ; echo", "`touch /tmp/blns.fail`", "$(touch /tmp/blns.fail)", "@{[system \"touch /tmp/blns.fail\"]}", "eval(\"puts \'hello world\'\")", "System(\"ls -al /\")", "`ls -al /`", "Kernel.exec(\"ls -al /\")", "Kernel.exit(1)", "%x(\'ls -al /\')", "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><!DOCTYPE foo [ <!ELEMENT foo ANY ><!E" + "NTITY xxe SYSTEM \"file:///etc/passwd\" >]><foo>&xxe;</foo>", "$HOME", "$ENV{\'HOME\'}", "%d", "%s%s%s%s%s", "{0}", "%*.*s", "%@", "%n", "File:///", "../../../../../../../../../../../etc/passwd%00", "../../../../../../../../../../../etc/hosts", "() { 0; }; touch /tmp/blns.shellshock1.fail;", "() { _; } >_[$($())] { touch /tmp/blns.shellshock2.fail; }", "<<< %s(un=\'%s\') = %u", "+++ATH0", "CON", "PRN", "AUX", "CLOCK$", "NUL", "A:", "ZZ:", "COM1", "LPT1", "LPT2", "LPT3", "COM2", "COM3", "COM4", "DCC SEND STARTKEYLOGGER 0 0 0", "Scunthorpe General Hospital", "Penistone Community Church", "Lightwater Country Park", "<NAME>", "Horniman Museum", "shitake mushrooms", "RomansInSussex.co.uk", "http://www.cum.qc.ca/", "<NAME>, Software Specialist", "<NAME>", "Dr. <NAME>", "magna cum laude", "Super Bowl XXX", "medieval erection of parapets", "evaluate", "mocha", "expression", "Arsenal canal", "classic", "<NAME>", "<NAME>", "basement", "If you\'re reading this, you\'ve been in a coma for almost 20 years now. We\'re tryi" + "ng a new technique. We don\'t know where this message will end up in your dream, " + "but we hope it works. Please wake up, we miss you.", "Roses are red, violets are blue. Hope you enjoy terminal hue", "But now...for my greatest trick...", "The quick brown fox... [Beeeep]", "Powerلُلُصّبُلُلصّبُررً ॣ ॣh ॣ ॣ冗", "🏳0🌈️", "జ్ఞ‌ా", "گچپژ", }; /// <summary> /// Strings which may be used elsewhere in code. /// </summary> public static IList<string> ReservedStrings = new List<string> { "undefined", "undef", "null", "NULL", "(null)", "nil", "NIL", "true", "false", "True", "False", "TRUE", "FALSE", "None", "hasOwnProperty", "then", "constructor", "\\", "\\\\", }; /// <summary> /// Strings which can be interpreted as numeric. /// </summary> public static IList<string> NumericStrings = new List<string> { "0", "1", "1.00", "$1.00", "1/2", "1E2", "1E02", "1E+02", "-1", "-1.00", "-$1.00", "-1/2", "-1E2", "-1E02", "-1E+02", "1/0", "0/0", "-2147483648/-1", "-9223372036854775808/-1", "-0", "-0.0", "+0", "+0.0", "0.00", "0..0", ".", "0.0.0", "0,00", "0,,0", ",", "0,0,0", "0.0/0", "1.0/0.0", "0.0/0.0", "1,0/0,0", "0,0/0,0", "--1", "-", "-.", "-,", "999999999999999999999999999999999999999999999999999999999999999999999999999999999" + "999999999999999", "NaN", "Infinity", "-Infinity", "INF", "1#INF", "-1#IND", "1#QNAN", "1#SNAN", "1#IND", "0x0", "0xffffffff", "0xffffffffffffffff", "0xabad1dea", "123456789012345678901234567890123456789", "1,000.00", "1 000.00", "1\'000.00", "1,000,000.00", "1 000 000.00", "1\'000\'000.00", "1.000,00", "1 000,00", "1\'000,00", "1.000.000,00", "1 000 000,00", "1\'000\'000,00", "01000", "08", "09", "2.2250738585072011e-308", }; /// <summary> /// ASCII punctuation. All of these characters may need to be escaped in some contexts. Divided into three groups based on (US-layout) keyboard position. /// </summary> public static IList<string> SpecialCharacters = new List<string> { ",./;\'[]\\-=", "<>?:\"{}|_+", "!@#$%^&*()`~", "", "€‚ƒ„†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ", @"\t             ​\u2028\u2029   ", @"­؀؁؂؃؄؅؜۝܏᠎​‌‍‎‏‪‫‬‭‮⁠⁡⁢⁣⁤⁦⁧⁨⁩𑂽𛲠𛲡𛲢𛲣𝅳𝅴𝅵𝅶𝅷𝅸𝅹𝅺󠀁󠀠󠀡󠀢󠀣󠀤󠀥󠀦󠀧󠀨󠀩󠀪󠀫󠀬󠀭󠀮󠀯󠀰󠀱󠀲󠀳󠀴󠀵󠀶󠀷󠀸󠀹󠀺󠀻󠀼󠀽󠀾󠀿󠁀󠁁󠁂󠁃󠁄󠁅󠁆󠁇󠁈󠁉󠁊󠁋󠁌󠁍󠁎󠁏󠁐󠁑󠁒󠁓󠁔󠁕󠁖󠁗󠁘󠁙󠁚󠁛󠁜󠁝󠁞󠁟󠁠󠁡󠁢󠁣󠁤󠁥󠁦󠁧󠁨󠁩󠁪󠁫󠁬󠁭󠁮󠁯󠁰󠁱󠁲󠁳󠁴󠁵󠁶󠁷󠁸󠁹󠁺󠁻󠁼󠁽󠁾󠁿", "", "￾", }; /// <summary> /// Strings which contain common unicode symbols (e.g. smart quotes). /// </summary> public static IList<string> UnicodeSymbols = new List<string> { "Ω≈ç√∫˜µ≤≥÷", "åß∂ƒ©˙∆˚¬…æ", "œ∑´®†¥¨ˆøπ“‘", "¡™£¢∞§¶•ªº–≠", "¸˛Ç◊ı˜Â¯˘¿", "ÅÍÎÏ˝ÓÔÒÚÆ☃", "Œ„´‰ˇÁ¨ˆØ∏”’", "`⁄€‹›fifl‡°·‚—±", "⅛⅜⅝⅞", "ЁЂЃЄЅІЇЈЉЊЋЌЍЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя", "٠١٢٣٤٥٦٧٨٩", }; /// <summary> /// Strings which contain unicode subscripts/superscripts; can cause rendering issues. /// </summary> public static IList<string> UnicodeSubscriptSuperscriptAccents = new List<string> { "⁰⁴⁵", "₀₁₂", "⁰⁴⁵₀₁₂", @"ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็ ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็ ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็", }; /// <summary> /// Strings which contain misplaced quotation marks; can cause encoding errors. /// </summary> public static IList<string> QuotationMarks = new List<string> { "\'", "\"", "\'\'", "\"\"", "\'\"\'", "\"\'\'\'\'\"\'\"", "\"\'\"\'\"\'\'\'\'\"", "<foo val=“bar” />", "<foo val=“bar” />", "<foo val=”bar“ />", "<foo val=`bar\' />", }; /// <summary> /// Strings which contain two-byte characters: can cause rendering issues or character-length issues. /// </summary> public static IList<string> TwoByteCharacters = new List<string> { "田中さんにあげて下さい", "パーティーへ行かないか", "和製漢語", "部落格", "사회과학원 어학연구소", "찦차를 타고 온 펲시맨과 쑛다리 똠방각하", "社會科學院語學研究所", "울란바토르", "𠜎𠜱𠝹𠱓𠱸𠲖𠳏", }; /// <summary> ///. /// </summary> public static IList<string> Stringswhichcontaintwobyteletters = new List<string> { "𐐜 𐐔𐐇𐐝𐐀𐐡𐐇𐐓 𐐙𐐊𐐡𐐝𐐓/𐐝𐐇𐐗𐐊𐐤𐐔 𐐒𐐋𐐗 𐐒𐐌 𐐜 𐐡𐐀𐐖𐐇𐐤𐐓𐐝 𐐱𐑂 𐑄 𐐔" + "𐐇𐐝𐐀𐐡𐐇𐐓 𐐏𐐆𐐅𐐤𐐆𐐚𐐊𐐡𐐝𐐆𐐓𐐆", }; /// <summary> /// A super string recommended by VMware Inc. Globalization Team: can effectively cause rendering issues or character-length issues to validate product globalization readiness. 表 CJK_UNIFIED_IDEOGRAPHS (U+8868) ポ KATAKANA LETTER PO (U+30DD) あ HIRAGANA LETTER A (U+3042) A LATIN CAPITAL LETTER A (U+0041) 鷗 CJK_UNIFIED_IDEOGRAPHS (U+9DD7) Œ LATIN SMALL LIGATURE OE (U+0153) é LATIN SMALL LETTER E WITH ACUTE (U+00E9) B FULLWIDTH LATIN CAPITAL LETTER B (U+FF22) 逍 CJK_UNIFIED_IDEOGRAPHS (U+900D) Ü LATIN SMALL LETTER U WITH DIAERESIS (U+00FC) ß LATIN SMALL LETTER SHARP S (U+00DF) ª FEMININE ORDINAL INDICATOR (U+00AA) ą LATIN SMALL LETTER A WITH OGONEK (U+0105) ñ LATIN SMALL LETTER N WITH TILDE (U+00F1) 丂 CJK_UNIFIED_IDEOGRAPHS (U+4E02) 㐀 CJK Ideograph Extension A, First (U+3400) 𠀀 CJK Ideograph Extension B, First (U+20000). /// </summary> public static IList<string> SpecialUnicodeCharactersUnion = new List<string> { "表", "ポ", "あ", "A", "鷗", "Œ", "é", "B", "逍", "Ü", "ß", "ª", "ą", "ñ", "丂", "㐀", "𠀀", }; /// <summary> /// Characters which increase in length (2 to 3 bytes) when lowercased Credit: https://twitter.com/jifa/status/625776454479970304. /// </summary> public static IList<string> Changinglengthwhenlowercased = new List<string> { "Ⱥ", "Ⱦ", }; /// <summary> /// Strings which consists of Japanese-style emoticons which are popular on the web. /// </summary> public static IList<string> JapaneseEmoticons = new List<string> { "ヽ༼ຈل͜ຈ༽ノ ヽ༼ຈل͜ຈ༽ノ", "(。◕ ∀ ◕。)", "`ィ(´∀`∩", "__ロ(,_,*)", "・( ̄∀ ̄)・:*:", "゚・✿ヾ╲(。◕‿◕。)╱✿・゚", ",。・:*:・゜’( ☻ ω ☻ )。・:*:・゜’", "(╯°□°)╯︵ ┻━┻)", "(ノಥ益ಥ)ノ ┻━┻", "┬─┬ノ( º _ ºノ)", "( ͡° ͜ʖ ͡°)", "¯\\_(ツ)_/¯", }; /// <summary> /// Strings which contain Emoji; should be the same behavior as two-byte characters, but not always. /// </summary> public static IList<string> Emoji = new List<string> { "😍", "👩🏽", "👨‍🦰 👨🏿‍🦰 👨‍🦱 👨🏿‍🦱 🦹🏿‍♂️", "👾 🙇 💁 🙅 🙆 🙋 🙎 🙍", "🐵 🙈 🙉 🙊", "❤️ 💔 💌 💕 💞 💓 💗 💖 💘 💝 💟 💜 💛 💚 💙", "✋🏿 💪🏿 👐🏿 🙌🏿 👏🏿 🙏🏿", "🚾 🆒 🆓 🆕 🆖 🆗 🆙 🏧", "0️⃣ 1️⃣ 2️⃣ 3️⃣ 4️⃣ 5️⃣ 6️⃣ 7️⃣ 8️⃣ 9️⃣ 🔟", "🇺🇸🇷🇺🇸 🇦🇫🇦🇲🇸", "🇺🇸🇷🇺🇸🇦🇫🇦🇲", "🇺🇸🇷🇺🇸🇦", }; /// <summary> /// Strings which contain unicode numbers; if the code is localized, it should see the input as numeric. /// </summary> public static IList<string> UnicodeNumbers = new List<string> { "123", "١٢٣", }; /// <summary> /// Strings which contain text that should be rendered RTL if possible (e.g. Arabic, Hebrew). /// </summary> public static IList<string> RightToLeftStrings = new List<string> { "ثم نفس سقطت وبالتحديد،, جزيرتي باستخدام أن دنو. إذ هنا؟ الستار وتنصيب كان. أهّل ا" + "يطاليا، بريطانيا-فرنسا قد أخذ. سليمان، إتفاقية بين ما, يذكر الحدود أي بعد, معامل" + "ة بولندا، الإطلاق عل إيو.", "בְּרֵאשִׁית, בָּרָא אֱלֹהִים, אֵת הַשָּׁמַיִם, וְאֵת הָאָרֶץ", "הָיְתָהtestالصفحات التّحول", "﷽", "ﷺ", "مُنَاقَشَةُ سُبُلِ اِسْتِخْدَامِ اللُّغَةِ فِي النُّظُمِ الْقَائِمَةِ وَفِيم يَخُ" + "صَّ التَّطْبِيقَاتُ الْحاسُوبِيَّةُ،", "الكل في المجمو عة (5)", }; /// <summary> /// The only unicode alphabet to use a space which isn't empty but should still act like a space. /// </summary> public static IList<string> OghamText = new List<string> { "᚛ᚄᚓᚐᚋᚒᚄ ᚑᚄᚂᚑᚏᚅ᚜", "᚛                 ᚜", }; /// <summary> /// Strings which contain unicode with unusual properties (e.g. Right-to-left override) (c.f. http://www.unicode.org/charts/PDF/U2000.pdf). /// </summary> public static IList<string> TrickUnicode = new List<string> { "‪‪test‪", "‫test‫", "\u2029test\u2029", "test⁠test‫", "⁦test⁧", }; /// <summary> /// Strings which contain "corrupted" text. The corruption will not appear in non-HTML text, however. (via http://www.eeemo.net). /// </summary> public static IList<string> ZalgoText = new List<string> { "Ṱ̺̺̕o͞ ̷i̲̬͇̪͙n̝̗͕v̟̜̘̦͟o̶̙̰̠kè͚̮̺̪̹̱̤ ̖t̝͕̳̣̻̪͞h̼͓̲̦̳̘̲e͇̣̰̦̬͎ ̢̼̻̱̘h͚͎͙̜̣̲ͅi̦̲̣" + "̰̤v̻͍e̺̭̳̪̰-m̢iͅn̖̺̞̲̯̰d̵̼̟͙̩̼̘̳ ̞̥̱̳̭r̛̗̘e͙p͠r̼̞̻̭̗e̺̠̣͟s̘͇̳͍̝͉e͉̥̯̞̲͚̬͜ǹ̬͎͎̟̖͇" + "̤t͍̬̤͓̼̭͘ͅi̪̱n͠g̴͉ ͏͉ͅc̬̟h͡a̫̻̯͘o̫̟̖͍̙̝͉s̗̦̲.̨̹͈̣", "̡͓̞ͅI̗̘̦͝n͇͇͙v̮̫ok̲̫̙͈i̖͙̭̹̠̞n̡̻̮̣̺g̲͈͙̭͙̬͎ ̰t͔̦h̞̲e̢̤ ͍̬̲͖f̴̘͕̣è͖ẹ̥̩l͖͔͚i͓͚̦͠n͖͍" + "̗͓̳̮g͍ ̨o͚̪͡f̘̣̬ ̖̘͖̟͙̮c҉͔̫͖͓͇͖ͅh̵̤̣͚͔á̗̼͕ͅo̼̣̥s̱͈̺̖̦̻͢.̛̖̞̠̫̰", "̗̺͖̹̯͓Ṯ̤͍̥͇͈h̲́e͏͓̼̗̙̼̣͔ ͇̜̱̠͓͍ͅN͕͠e̗̱z̘̝̜̺͙p̤̺̹͍̯͚e̠̻̠͜r̨̤͍̺̖͔̖̖d̠̟̭̬̝͟i̦͖̩͓͔̤a̠" + "̗̬͉̙n͚͜ ̻̞̰͚ͅh̵͉i̳̞v̢͇ḙ͎͟-҉̭̩̼͔m̤̭̫i͕͇̝̦n̗͙ḍ̟ ̯̲͕͞ǫ̟̯̰̲͙̻̝f ̪̰̰̗̖̭̘͘c̦͍̲̞͍̩̙ḥ͚a̮" + "͎̟̙͜ơ̩̹͎s̤.̝̝ ҉Z̡̖̜͖̰̣͉̜a͖̰͙̬͡l̲̫̳͍̩g̡̟̼̱͚̞̬ͅo̗͜.̟", "̦H̬̤̗̤͝e͜ ̜̥̝̻͍̟́w̕h̖̯͓o̝͙̖͎̱̮ ҉̺̙̞̟͈W̷̼̭a̺̪͍į͈͕̭͙̯̜t̶̼̮s̘͙͖̕ ̠̫̠B̻͍͙͉̳ͅe̵h̵̬͇̫͙i" + "̹͓̳̳̮͎̫̕n͟d̴̪̜̖ ̰͉̩͇͙̲͞ͅT͖̼͓̪͢h͏͓̮̻e̬̝̟ͅ ̤̹̝W͙̞̝͔͇͝ͅa͏͓͔̹̼̣l̴͔̰̤̟͔ḽ̫.͕", "Z̮̞̠͙͔ͅḀ̗̞͈̻̗Ḷ͙͎̯̹̞͓G̻O̭̗̮", }; /// <summary> /// Strings which contain unicode with an "upsidedown" effect (via http://www.upsidedowntext.com). /// </summary> public static IList<string> UnicodeUpsidedown = new List<string> { "˙ɐnbᴉlɐ ɐuƃɐɯ ǝɹolop ʇǝ ǝɹoqɐl ʇn ʇunpᴉpᴉɔuᴉ ɹodɯǝʇ poɯsnᴉǝ op pǝs \'ʇᴉlǝ ƃuᴉɔsᴉdᴉ" + "pɐ ɹnʇǝʇɔǝsuoɔ \'ʇǝɯɐ ʇᴉs ɹolop ɯnsdᴉ ɯǝɹo˥", "00˙Ɩ$-", }; /// <summary> /// Strings which contain bold/italic/etc. versions of normal characters. /// </summary> public static IList<string> Unicodefont = new List<string> { "The quick brown fox jumps over the lazy dog", "𝐓𝐡𝐞 𝐪𝐮𝐢𝐜𝐤 𝐛𝐫𝐨𝐰𝐧 𝐟𝐨𝐱 𝐣𝐮𝐦𝐩𝐬 𝐨𝐯𝐞𝐫 𝐭𝐡𝐞 𝐥𝐚𝐳𝐲 𝐝𝐨𝐠", "𝕿𝖍𝖊 𝖖𝖚𝖎𝖈𝖐 𝖇𝖗𝖔𝖜𝖓 𝖋𝖔𝖝 𝖏𝖚𝖒𝖕𝖘 𝖔𝖛𝖊𝖗 𝖙𝖍𝖊 𝖑𝖆𝖟𝖞 𝖉𝖔𝖌", "𝑻𝒉𝒆 𝒒𝒖𝒊𝒄𝒌 𝒃𝒓𝒐𝒘𝒏 𝒇𝒐𝒙 𝒋𝒖𝒎𝒑𝒔 𝒐𝒗𝒆𝒓 𝒕𝒉𝒆 𝒍𝒂𝒛𝒚 𝒅𝒐𝒈", "𝓣𝓱𝓮 𝓺𝓾𝓲𝓬𝓴 𝓫𝓻𝓸𝔀𝓷 𝓯𝓸𝔁 𝓳𝓾𝓶𝓹𝓼 𝓸𝓿𝓮𝓻 𝓽𝓱𝓮 𝓵𝓪𝔃𝔂 𝓭𝓸𝓰", "𝕋𝕙𝕖 𝕢𝕦𝕚𝕔𝕜 𝕓𝕣𝕠𝕨𝕟 𝕗𝕠𝕩 𝕛𝕦𝕞𝕡𝕤 𝕠𝕧𝕖𝕣 𝕥𝕙𝕖 𝕝𝕒𝕫𝕪 𝕕𝕠𝕘", "𝚃𝚑𝚎 𝚚𝚞𝚒𝚌𝚔 𝚋𝚛𝚘𝚠𝚗 𝚏𝚘𝚡 𝚓𝚞𝚖𝚙𝚜 𝚘𝚟𝚎𝚛 𝚝𝚑𝚎 𝚕𝚊𝚣𝚢 𝚍𝚘𝚐", "⒯⒣⒠ ⒬⒰⒤⒞⒦ ⒝⒭⒪⒲⒩ ⒡⒪⒳ ⒥⒰⒨⒫⒮ ⒪⒱⒠⒭ ⒯⒣⒠ ⒧⒜⒵⒴ ⒟⒪⒢", }; /// <summary> /// Strings which attempt to invoke a benign script injection; shows vulnerability to XSS. /// </summary> public static IList<string> ScriptInjection = new List<string> { "<script>alert(123)</script>", "&lt;script&gt;alert(&#39;123&#39;);&lt;/script&gt;", "<img src=x onerror=alert(123) />", "<svg><script>123<1>alert(123)</script>", "\"><script>alert(123)</script>", "\'><script>alert(123)</script>", "><script>alert(123)</script>", "</script><script>alert(123)</script>", "< / script >< script >alert(123)< / script >", " onfocus=JaVaSCript:alert(123) autofocus", "\" onfocus=JaVaSCript:alert(123) autofocus", "\' onfocus=JaVaSCript:alert(123) autofocus", "<script>alert(123)</script>", "<sc<script>ript>alert(123)</sc</script>ript>", "--><script>alert(123)</script>", "\";alert(123);t=\"", "\';alert(123);t=\'", "JavaSCript:alert(123)", ";alert(123);", "src=JaVaSCript:prompt(132)", "\"><script>alert(123);</script x=\"", "\'><script>alert(123);</script x=\'", "><script>alert(123);</script x=", "\" autofocus onkeyup=\"javascript:alert(123)", "\' autofocus onkeyup=\'javascript:alert(123)", "<script\\x20type=\"text/javascript\">javascript:alert(1);</script>", "<script\\x3Etype=\"text/javascript\">javascript:alert(1);</script>", "<script\\x0Dtype=\"text/javascript\">javascript:alert(1);</script>", "<script\\x09type=\"text/javascript\">javascript:alert(1);</script>", "<script\\x0Ctype=\"text/javascript\">javascript:alert(1);</script>", "<script\\x2Ftype=\"text/javascript\">javascript:alert(1);</script>", "<script\\x0Atype=\"text/javascript\">javascript:alert(1);</script>", "\'`\"><\\x3Cscript>javascript:alert(1)</script>", "\'`\"><\\x00script>javascript:alert(1)</script>", "ABC<div style=\"x\\x3Aexpression(javascript:alert(1)\">DEF", "ABC<div style=\"x:expression\\x5C(javascript:alert(1)\">DEF", "ABC<div style=\"x:expression\\x00(javascript:alert(1)\">DEF", "ABC<div style=\"x:exp\\x00ression(javascript:alert(1)\">DEF", "ABC<div style=\"x:exp\\x5Cression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\x0Aexpression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\x09expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE3\\x80\\x80expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x84expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xC2\\xA0expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x80expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x8Aexpression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\x0Dexpression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\x0Cexpression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x87expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xEF\\xBB\\xBFexpression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\x20expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x88expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\x00expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x8Bexpression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x86expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x85expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x82expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\x0Bexpression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x81expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x83expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x89expression(javascript:alert(1)\">DEF", "<a href=\"\\x0Bjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x0Fjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xC2\\xA0javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x05javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE1\\xA0\\x8Ejavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x18javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x11javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\x88javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\x89javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\x80javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x17javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x03javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x0Ejavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x1Ajavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x00javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x10javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\x82javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x20javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x13javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x09javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\x8Ajavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x14javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x19javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\xAFjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x1Fjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\x81javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x1Djavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\x87javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x07javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE1\\x9A\\x80javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\x83javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x04javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x01javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x08javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\x84javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\x86javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE3\\x80\\x80javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x12javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x0Djavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x0Ajavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x0Cjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x15javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\xA8javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x16javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x02javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x1Bjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x06javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\xA9javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x80\\x85javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x1Ejavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\xE2\\x81\\x9Fjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"\\x1Cjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"javascript\\x00:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"javascript\\x3A:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"javascript\\x09:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"javascript\\x0D:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "<a href=\"javascript\\x0A:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "`\"\'><img src=xxx:x \\x0Aonerror=javascript:alert(1)>", "`\"\'><img src=xxx:x \\x22onerror=javascript:alert(1)>", "`\"\'><img src=xxx:x \\x0Bonerror=javascript:alert(1)>", "`\"\'><img src=xxx:x \\x0Donerror=javascript:alert(1)>", "`\"\'><img src=xxx:x \\x2Fonerror=javascript:alert(1)>", "`\"\'><img src=xxx:x \\x09onerror=javascript:alert(1)>", "`\"\'><img src=xxx:x \\x0Conerror=javascript:alert(1)>", "`\"\'><img src=xxx:x \\x00onerror=javascript:alert(1)>", "`\"\'><img src=xxx:x \\x27onerror=javascript:alert(1)>", "`\"\'><img src=xxx:x \\x20onerror=javascript:alert(1)>", "\"`\'><script>\\x3Bjavascript:alert(1)</script>", "\"`\'><script>\\x0Djavascript:alert(1)</script>", "\"`\'><script>\\xEF\\xBB\\xBFjavascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\x81javascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\x84javascript:alert(1)</script>", "\"`\'><script>\\xE3\\x80\\x80javascript:alert(1)</script>", "\"`\'><script>\\x09javascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\x89javascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\x85javascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\x88javascript:alert(1)</script>", "\"`\'><script>\\x00javascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\xA8javascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\x8Ajavascript:alert(1)</script>", "\"`\'><script>\\xE1\\x9A\\x80javascript:alert(1)</script>", "\"`\'><script>\\x0Cjavascript:alert(1)</script>", "\"`\'><script>\\x2Bjavascript:alert(1)</script>", "\"`\'><script>\\xF0\\x90\\x96\\x9Ajavascript:alert(1)</script>", "\"`\'><script>-javascript:alert(1)</script>", "\"`\'><script>\\x0Ajavascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\xAFjavascript:alert(1)</script>", "\"`\'><script>\\x7Ejavascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\x87javascript:alert(1)</script>", "\"`\'><script>\\xE2\\x81\\x9Fjavascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\xA9javascript:alert(1)</script>", "\"`\'><script>\\xC2\\x85javascript:alert(1)</script>", "\"`\'><script>\\xEF\\xBF\\xAEjavascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\x83javascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\x8Bjavascript:alert(1)</script>", "\"`\'><script>\\xEF\\xBF\\xBEjavascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\x80javascript:alert(1)</script>", "\"`\'><script>\\x21javascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\x82javascript:alert(1)</script>", "\"`\'><script>\\xE2\\x80\\x86javascript:alert(1)</script>", "\"`\'><script>\\xE1\\xA0\\x8Ejavascript:alert(1)</script>", "\"`\'><script>\\x0Bjavascript:alert(1)</script>", "\"`\'><script>\\x20javascript:alert(1)</script>", "\"`\'><script>\\xC2\\xA0javascript:alert(1)</script>", "<img \\x00src=x onerror=\"alert(1)\">", "<img \\x47src=x onerror=\"javascript:alert(1)\">", "<img \\x11src=x onerror=\"javascript:alert(1)\">", "<img \\x12src=x onerror=\"javascript:alert(1)\">", "<img\\x47src=x onerror=\"javascript:alert(1)\">", "<img\\x10src=x onerror=\"javascript:alert(1)\">", "<img\\x13src=x onerror=\"javascript:alert(1)\">", "<img\\x32src=x onerror=\"javascript:alert(1)\">", "<img\\x47src=x onerror=\"javascript:alert(1)\">", "<img\\x11src=x onerror=\"javascript:alert(1)\">", "<img \\x47src=x onerror=\"javascript:alert(1)\">", "<img \\x34src=x onerror=\"javascript:alert(1)\">", "<img \\x39src=x onerror=\"javascript:alert(1)\">", "<img \\x00src=x onerror=\"javascript:alert(1)\">", "<img src\\x09=x onerror=\"javascript:alert(1)\">", "<img src\\x10=x onerror=\"javascript:alert(1)\">", "<img src\\x13=x onerror=\"javascript:alert(1)\">", "<img src\\x32=x onerror=\"javascript:alert(1)\">", "<img src\\x12=x onerror=\"javascript:alert(1)\">", "<img src\\x11=x onerror=\"javascript:alert(1)\">", "<img src\\x00=x onerror=\"javascript:alert(1)\">", "<img src\\x47=x onerror=\"javascript:alert(1)\">", "<img src=x\\x09onerror=\"javascript:alert(1)\">", "<img src=x\\x10onerror=\"javascript:alert(1)\">", "<img src=x\\x11onerror=\"javascript:alert(1)\">", "<img src=x\\x12onerror=\"javascript:alert(1)\">", "<img src=x\\x13onerror=\"javascript:alert(1)\">", "<img[a][b][c]src[d]=x[e]onerror=[f]\"alert(1)\">", "<img src=x onerror=\\x09\"javascript:alert(1)\">", "<img src=x onerror=\\x10\"javascript:alert(1)\">", "<img src=x onerror=\\x11\"javascript:alert(1)\">", "<img src=x onerror=\\x12\"javascript:alert(1)\">", "<img src=x onerror=\\x32\"javascript:alert(1)\">", "<img src=x onerror=\\x00\"javascript:alert(1)\">", "<a href=java&#1&#2&#3&#4&#5&#6&#7&#8&#11&#12script:javascript:alert(1)>XXX</a>", "<img src=\"x` `<script>javascript:alert(1)</script>\"` `>", "<img src onerror /\" \'\"= alt=javascript:alert(1)//\">", "<title onpropertychange=javascript:alert(1)></title><title title=>", "<a href=http://foo.bar/#x=`y></a><img alt=\"`><img src=x:x onerror=javascript:aler" + "t(1)></a>\">", "<!--[if]><script>javascript:alert(1)</script -->", "<!--[if<img src=x onerror=javascript:alert(1)//]> -->", "<script src=\"/\\%(jscript)s\"></script>", "<script src=\"\\\\%(jscript)s\"></script>", "<IMG \"\"\"><SCRIPT>alert(\"XSS\")</SCRIPT>\">", "<IMG SRC=javascript:alert(String.fromCharCode(88,83,83))>", "<IMG SRC=# onmouseover=\"alert(\'xxs\')\">", "<IMG SRC= onmouseover=\"alert(\'xxs\')\">", "<IMG onmouseover=\"alert(\'xxs\')\">", "<IMG SRC=&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;&#97;&#108" + ";&#101;&#114;&#116;&#40;&#39;&#88;&#83;&#83;&#39;&#41;>", "<IMG SRC=&#0000106&#0000097&#0000118&#0000097&#0000115&#0000099&#0000114&#0000105" + "&#0000112&#0000116&#0000058&#0000097&#0000108&#0000101&#0000114&#0000116&#000004" + "0&#0000039&#0000088&#0000083&#0000083&#0000039&#0000041>", "<IMG SRC=&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A&#x61&#x6C&#x65&#" + "x72&#x74&#x28&#x27&#x58&#x53&#x53&#x27&#x29>", "<IMG SRC=\"jav ascript:alert(\'XSS\');\">", "<IMG SRC=\"jav&#x09;ascript:alert(\'XSS\');\">", "<IMG SRC=\"jav&#x0A;ascript:alert(\'XSS\');\">", "<IMG SRC=\"jav&#x0D;ascript:alert(\'XSS\');\">", "perl -e \'print \"<IMG SRC=java\\0script:alert(\\\"XSS\\\")>\";\' > out", "<IMG SRC=\" &#14; javascript:alert(\'XSS\');\">", "<SCRIPT/XSS SRC=\"http://ha.ckers.org/xss.js\"></SCRIPT>", "<BODY onload!#$%&()*~+-_.,:;?@[/|\\]^`=alert(\"XSS\")>", "<SCRIPT/SRC=\"http://ha.ckers.org/xss.js\"></SCRIPT>", "<<SCRIPT>alert(\"XSS\");//<</SCRIPT>", "<SCRIPT SRC=http://ha.ckers.org/xss.js?< B >", "<SCRIPT SRC=//ha.ckers.org/.j>", "<IMG SRC=\"javascript:alert(\'XSS\')\"", "<iframe src=http://ha.ckers.org/scriptlet.html <", "\\\";alert(\'XSS\');//", "<u oncopy=alert()> Copy me</u>", "<i onwheel=alert(1)> Scroll over me </i>", "<plaintext>", "http://a/%%30%30", "</textarea><script>alert(123)</script>", }; /// <summary> /// Strings which can cause a SQL injection if inputs are not sanitized. /// </summary> public static IList<string> SQLInjection = new List<string> { "1;DROP TABLE users", "1\'; DROP TABLE users-- 1", "\' OR 1=1 -- 1", "\' OR \'1\'=\'1", " ", "%", "_", }; /// <summary> /// Strings which can cause user to run code on server as a privileged user (c.f. https://news.ycombinator.com/item?id=7665153). /// </summary> public static IList<string> ServerCodeInjection = new List<string> { "-", "--", "--version", "--help", "$USER", "/dev/null; touch /tmp/blns.fail ; echo", "`touch /tmp/blns.fail`", "$(touch /tmp/blns.fail)", "@{[system \"touch /tmp/blns.fail\"]}", }; /// <summary> /// Strings which can call system commands within Ruby/Rails applications. /// </summary> public static IList<string> CommandInjectionRuby = new List<string> { "eval(\"puts \'hello world\'\")", "System(\"ls -al /\")", "`ls -al /`", "Kernel.exec(\"ls -al /\")", "Kernel.exit(1)", "%x(\'ls -al /\')", "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><!DOCTYPE foo [ <!ELEMENT foo ANY ><!E" + "NTITY xxe SYSTEM \"file:///etc/passwd\" >]><foo>&xxe;</foo>", }; /// <summary> /// Strings which can be accidentally expanded into different strings if evaluated in the wrong context, e.g. used as a printf format string or via Perl or shell eval. Might expose sensitive data from the program doing the interpolation, or might just represent the wrong string. /// </summary> public static IList<string> UnwantedInterpolation = new List<string> { "$HOME", "$ENV{\'HOME\'}", "%d", "%s%s%s%s%s", "{0}", "%*.*s", "%@", "%n", "File:///", }; /// <summary> /// Strings which can cause user to pull in files that should not be a part of a web server. /// </summary> public static IList<string> FileInclusion = new List<string> { "../../../../../../../../../../../etc/passwd%00", "../../../../../../../../../../../etc/hosts", }; /// <summary> /// Strings that test for known vulnerabilities. /// </summary> public static IList<string> KnownCVEsandVulnerabilities = new List<string> { "() { 0; }; touch /tmp/blns.shellshock1.fail;", "() { _; } >_[$($())] { touch /tmp/blns.shellshock2.fail; }", "<<< %s(un=\'%s\') = %u", "+++ATH0", }; /// <summary> /// Strings which are reserved characters in MSDOS/Windows. /// </summary> public static IList<string> MSDOSWindowsSpecialFilenames = new List<string> { "CON", "PRN", "AUX", "CLOCK$", "NUL", "A:", "ZZ:", "COM1", "LPT1", "LPT2", "LPT3", "COM2", "COM3", "COM4", "DCC SEND STARTKEYLOGGER 0 0 0", }; /// <summary> /// Innocuous strings which may be blocked by profanity filters (https://en.wikipedia.org/wiki/Scunthorpe_problem). /// </summary> public static IList<string> ScunthorpeProblem = new List<string> { "Scunthorpe General Hospital", "Penistone Community Church", "Lightwater Country Park", "<NAME>", "Horniman Museum", "shitake mushrooms", "RomansInSussex.co.uk", "http://www.cum.qc.ca/", "<NAME>, Software Specialist", "<NAME>", "Dr. <NAME>", "magna cum laude", "Super Bowl XXX", "medieval erection of parapets", "evaluate", "mocha", "expression", "Arsenal canal", "classic", "<NAME>", "<NAME>", "basement", }; /// <summary> /// Strings which may cause human to reinterpret worldview. /// </summary> public static IList<string> Humaninjection = new List<string> { "If you\'re reading this, you\'ve been in a coma for almost 20 years now. We\'re tryi" + "ng a new technique. We don\'t know where this message will end up in your dream, " + "but we hope it works. Please wake up, we miss you.", }; /// <summary> /// Strings which punish the fools who use cat/type on this file. /// </summary> public static IList<string> Terminalescapecodes = new List<string> { "Roses are red, violets are blue. Hope you enjoy terminal hue", "But now...for my greatest trick...", "The quick brown fox... [Beeeep]", }; /// <summary> /// Strings which crashed iMessage in various versions of iOS. /// </summary> public static IList<string> iOSVulnerabilities = new List<string> { "Powerلُلُصّبُلُلصّبُررً ॣ ॣh ॣ ॣ冗", "🏳0🌈️", "జ్ఞ‌ా", "گچپژ", }; } } ======================= File: src/RandomDataGenerator.Gui/UserControls/BaseUserControlOutput.cs ======================= <filename>src/RandomDataGenerator.Gui/UserControls/BaseUserControlOutput.cs using System.Windows.Forms; using RandomDataGenerator.Gui.Generation; namespace RandomDataGenerator.Gui.UserControls { public abstract class BaseUserControlOutput<TOptions> : UserControl where TOptions : BaseGenerateOptions, new() { protected TOptions GenerateOptions; protected BaseUserControlOutput() : this(new TOptions()) { } protected BaseUserControlOutput(TOptions options) { GenerateOptions = options; } public virtual void UpdateControls(TOptions options) { GenerateOptions = options; } public virtual TOptions GetGenerateOptions() { return GenerateOptions; } } } ======================= File: src/RandomDataGenerator.Gui/UserControlsFields/UserControlTextWords.Designer.cs ======================= <reponame>brunotarghetta/RandomDataGenerator<gh_stars>10-100 namespace RandomDataGenerator.Gui.UserControlsFields { partial class UserControlTextWords { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components!= null)) { components.Dispose(); } base.Dispose(disposing); } #region Component Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.lblFrom = new System.Windows.Forms.Label(); this.lblTo = new System.Windows.Forms.Label(); this.ctrlMin = new System.Windows.Forms.NumericUpDown(); this.ctrlMax = new System.Windows.Forms.NumericUpDown(); this.lblWords = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.ctrlMin)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.ctrlMax)).BeginInit(); this.SuspendLayout(); // // lblFrom // this.lblFrom.AutoSize = true; this.lblFrom.Location = new System.Drawing.Point(4, 8); this.lblFrom.Name = "lblFrom"; this.lblFrom.Size = new System.Drawing.Size(30, 13); this.lblFrom.TabIndex = 0; this.lblFrom.Text = "From"; // // lblTo // this.lblTo.AutoSize = true; this.lblTo.Location = new System.Drawing.Point(86, 8); this.lblTo.Name = "lblTo"; this.lblTo.Size = new System.Drawing.Size(16, 13); this.lblTo.TabIndex = 2; this.lblTo.Text = "to"; // // ctrlMin // this.ctrlMin.Location = new System.Drawing.Point(40, 4); this.ctrlMin.Maximum = new decimal(new int[] { 99999999, 0, 0, 0}); this.ctrlMin.Name = "ctrlMin"; this.ctrlMin.Size = new System.Drawing.Size(40, 20); this.ctrlMin.TabIndex = 1; this.ctrlMin.ValueChanged += new System.EventHandler(this.EventValueChangedMin); // // ctrlMax // this.ctrlMax.Location = new System.Drawing.Point(108, 4); this.ctrlMax.Name = "ctrlMax"; this.ctrlMax.Size = new System.Drawing.Size(40, 20); this.ctrlMax.TabIndex = 3; this.ctrlMax.Value = new decimal(new int[] { 5, 0, 0, 0}); this.ctrlMax.ValueChanged += new System.EventHandler(this.EventValueChangedMax); // // lblWords // this.lblWords.AutoSize = true; this.lblWords.Location = new System.Drawing.Point(154, 8); this.lblWords.Name = "lblWords"; this.lblWords.Size = new System.Drawing.Size(38, 13); this.lblWords.TabIndex = 4; this.lblWords.Text = "words."; // // UserControlTextWords // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.lblWords); this.Controls.Add(this.ctrlMax); this.Controls.Add(this.ctrlMin); this.Controls.Add(this.lblTo); this.Controls.Add(this.lblFrom); this.Name = "UserControlTextWords"; this.Size = new System.Drawing.Size(350, 60); ((System.ComponentModel.ISupportInitialize)(this.ctrlMin)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.ctrlMax)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.Label lblFrom; private System.Windows.Forms.Label lblTo; private System.Windows.Forms.NumericUpDown ctrlMin; private System.Windows.Forms.NumericUpDown ctrlMax; private System.Windows.Forms.Label lblWords; } } ======================= File: src/RandomDataGenerator.Gui/MainForm.Designer.cs ======================= <reponame>brunotarghetta/RandomDataGenerator  using RandomDataGenerator.Gui.UserControls; namespace RandomDataGenerator.Gui { partial class MainForm { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components!= null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); this.menuStrip = new System.Windows.Forms.MenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.loadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.tabTotal = new System.Windows.Forms.TabControl(); this.tabFields = new System.Windows.Forms.TabPage(); this.btnDown = new System.Windows.Forms.Button(); this.btnUp = new System.Windows.Forms.Button(); this.btnDeleteField = new System.Windows.Forms.Button(); this.btnAddField = new System.Windows.Forms.Button(); this.lblFields = new System.Windows.Forms.Label(); this.listBoxFields = new System.Windows.Forms.ListBox(); this.boxDetials = new System.Windows.Forms.GroupBox(); this.lblHiddenId = new System.Windows.Forms.Label(); this.boxOptions = new System.Windows.Forms.GroupBox(); this.panelFieldOptions = new System.Windows.Forms.Panel(); this.userControlExample = new RandomDataGenerator.Gui.UserControls.UserControlExample(); this.btnSaveField = new System.Windows.Forms.Button(); this.boxFieldType = new System.Windows.Forms.GroupBox(); this.lblSubType = new System.Windows.Forms.Label(); this.cmbSubFields = new System.Windows.Forms.ComboBox(); this.lblType = new System.Windows.Forms.Label(); this.cmbFields = new System.Windows.Forms.ComboBox(); this.txtFieldName = new System.Windows.Forms.TextBox(); this.lblFieldName = new System.Windows.Forms.Label(); this.tabOutput = new System.Windows.Forms.TabPage(); this.btnGenerate = new System.Windows.Forms.Button(); this.boxOutputOptions = new System.Windows.Forms.GroupBox(); this.panelOutput = new System.Windows.Forms.Panel(); this.btnBrowseFile = new System.Windows.Forms.Button(); this.txtOutputFile = new System.Windows.Forms.TextBox(); this.lblOutputFile = new System.Windows.Forms.Label(); this.numTotalRecords = new System.Windows.Forms.NumericUpDown(); this.lblNumRecords = new System.Windows.Forms.Label(); this.boxOutputType = new System.Windows.Forms.GroupBox(); this.rbOutputSQL = new System.Windows.Forms.RadioButton(); this.statusStrip = new System.Windows.Forms.StatusStrip(); this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); this.menuStrip.SuspendLayout(); this.tabTotal.SuspendLayout(); this.tabFields.SuspendLayout(); this.boxDetials.SuspendLayout(); this.boxOptions.SuspendLayout(); this.panelFieldOptions.SuspendLayout(); this.boxFieldType.SuspendLayout(); this.tabOutput.SuspendLayout(); this.boxOutputOptions.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numTotalRecords)).BeginInit(); this.boxOutputType.SuspendLayout(); this.statusStrip.SuspendLayout(); this.SuspendLayout(); // // menuStrip // this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.fileToolStripMenuItem}); this.menuStrip.Location = new System.Drawing.Point(0, 0); this.menuStrip.Name = "menuStrip"; this.menuStrip.Size = new System.Drawing.Size(704, 24); this.menuStrip.TabIndex = 0; this.menuStrip.Text = "menuStrip"; // // fileToolStripMenuItem // this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.saveToolStripMenuItem, this.loadToolStripMenuItem, this.exitToolStripMenuItem}); this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; this.fileToolStripMenuItem.Size = new System.Drawing.Size(56, 20); this.fileToolStripMenuItem.Text = "&Project"; // // saveToolStripMenuItem // this.saveToolStripMenuItem.Image = global::RandomDataGenerator.Gui.Properties.Resources.table_save; this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; this.saveToolStripMenuItem.Size = new System.Drawing.Size(100, 22); this.saveToolStripMenuItem.Text = "&Save"; this.saveToolStripMenuItem.Click += new System.EventHandler(this.ClickEventMenuSave); // // loadToolStripMenuItem // this.loadToolStripMenuItem.Image = global::RandomDataGenerator.Gui.Properties.Resources.folder_database; this.loadToolStripMenuItem.Name = "loadToolStripMenuItem"; this.loadToolStripMenuItem.Size = new System.Drawing.Size(100, 22); this.loadToolStripMenuItem.Text = "&Load"; this.loadToolStripMenuItem.Click += new System.EventHandler(this.ClickEventMenuLoad); // // exitToolStripMenuItem // this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; this.exitToolStripMenuItem.Size = new System.Drawing.Size(100, 22); this.exitToolStripMenuItem.Text = "&Exit"; this.exitToolStripMenuItem.Click += new System.EventHandler(this.ClickEventMenuExit); // // tabTotal // this.tabTotal.Controls.Add(this.tabFields); this.tabTotal.Controls.Add(this.tabOutput); this.tabTotal.Dock = System.Windows.Forms.DockStyle.Fill; this.tabTotal.Location = new System.Drawing.Point(0, 24); this.tabTotal.Name = "tabTotal"; this.tabTotal.SelectedIndex = 0; this.tabTotal.Size = new System.Drawing.Size(704, 597); this.tabTotal.TabIndex = 1; this.tabTotal.Text = "Output"; // // tabFields // this.tabFields.Controls.Add(this.btnDown); this.tabFields.Controls.Add(this.btnUp); this.tabFields.Controls.Add(this.btnDeleteField); this.tabFields.Controls.Add(this.btnAddField); this.tabFields.Controls.Add(this.lblFields); this.tabFields.Controls.Add(this.listBoxFields); this.tabFields.Controls.Add(this.boxDetials); this.tabFields.Location = new System.Drawing.Point(4, 22); this.tabFields.Name = "tabFields"; this.tabFields.Padding = new System.Windows.Forms.Padding(3); this.tabFields.Size = new System.Drawing.Size(696, 571); this.tabFields.TabIndex = 0; this.tabFields.Text = "Fields"; this.tabFields.UseVisualStyleBackColor = true; // // btnDown // this.btnDown.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", this, "IsMoveDownFieldEnabled", true)); this.btnDown.Enabled = false; this.btnDown.Image = global::RandomDataGenerator.Gui.Properties.Resources.arrow_down; this.btnDown.Location = new System.Drawing.Point(142, 528); this.btnDown.Name = "btnDown"; this.btnDown.Size = new System.Drawing.Size(30, 24); this.btnDown.TabIndex = 8; this.btnDown.UseVisualStyleBackColor = true; this.btnDown.Click += new System.EventHandler(this.btnDown_Click); // // btnUp // this.btnUp.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", this, "IsMoveUpFieldEnabled", true)); this.btnUp.Enabled = false; this.btnUp.Image = global::RandomDataGenerator.Gui.Properties.Resources.arrow_up; this.btnUp.Location = new System.Drawing.Point(106, 528); this.btnUp.Name = "btnUp"; this.btnUp.Size = new System.Drawing.Size(30, 24); this.btnUp.TabIndex = 7; this.btnUp.UseVisualStyleBackColor = true; this.btnUp.Click += new System.EventHandler(this.btnUp_Click); // // btnDeleteField // this.btnDeleteField.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", this, "ListHasItems", true)); this.btnDeleteField.Enabled = false; this.btnDeleteField.Image = global::RandomDataGenerator.Gui.Properties.Resources.delete; this.btnDeleteField.Location = new System.Drawing.Point(58, 528); this.btnDeleteField.Name = "btnDeleteField"; this.btnDeleteField.Size = new System.Drawing.Size(30, 24); this.btnDeleteField.TabIndex = 6; this.btnDeleteField.UseVisualStyleBackColor = true; this.btnDeleteField.Click += new System.EventHandler(this.btnDeleteField_Click); // // btnAddField // this.btnAddField.Image = global::RandomDataGenerator.Gui.Properties.Resources.add; this.btnAddField.Location = new System.Drawing.Point(22, 528); this.btnAddField.Name = "btnAddField"; this.btnAddField.Size = new System.Drawing.Size(30, 24); this.btnAddField.TabIndex = 5; this.btnAddField.UseVisualStyleBackColor = true; this.btnAddField.Click += new System.EventHandler(this.btnAddField_Click); // // lblFields // this.lblFields.AutoSize = true; this.lblFields.Location = new System.Drawing.Point(19, 7); this.lblFields.Name = "lblFields"; this.lblFields.Size = new System.Drawing.Size(34, 13); this.lblFields.TabIndex = 2; this.lblFields.Text = "Fields"; // // listBoxFields // this.listBoxFields.DisplayMember = "Name"; this.listBoxFields.Location = new System.Drawing.Point(22, 23); this.listBoxFields.Name = "listBoxFields"; this.listBoxFields.Size = new System.Drawing.Size(150, 498); this.listBoxFields.TabIndex = 1; this.listBoxFields.SelectedIndexChanged += new System.EventHandler(this.listBoxFields_SelectedIndexChanged); // // boxDetials // this.boxDetials.Controls.Add(this.lblHiddenId); this.boxDetials.Controls.Add(this.boxOptions); this.boxDetials.Controls.Add(this.btnSaveField); this.boxDetials.Controls.Add(this.boxFieldType); this.boxDetials.Controls.Add(this.txtFieldName); this.boxDetials.Controls.Add(this.lblFieldName); this.boxDetials.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", this, "IsDataFieldSelected", true)); this.boxDetials.Location = new System.Drawing.Point(210, 23); this.boxDetials.Name = "boxDetials"; this.boxDetials.Size = new System.Drawing.Size(460, 498); this.boxDetials.TabIndex = 0; this.boxDetials.TabStop = false; this.boxDetials.Text = "Details"; // // lblHiddenId // this.lblHiddenId.AutoSize = true; this.lblHiddenId.Location = new System.Drawing.Point(368, 22); this.lblHiddenId.Name = "lblHiddenId"; this.lblHiddenId.Size = new System.Drawing.Size(35, 13); this.lblHiddenId.TabIndex = 5; this.lblHiddenId.Text = "####"; this.lblHiddenId.Visible = false; // // boxOptions // this.boxOptions.Controls.Add(this.panelFieldOptions); this.boxOptions.Location = new System.Drawing.Point(10, 153); this.boxOptions.Name = "boxOptions"; this.boxOptions.Size = new System.Drawing.Size(420, 333); this.boxOptions.TabIndex = 4; this.boxOptions.TabStop = false; this.boxOptions.Text = "Options"; // // panelFieldOptions // this.panelFieldOptions.Controls.Add(this.userControlExample); this.panelFieldOptions.Location = new System.Drawing.Point(10, 19); this.panelFieldOptions.Name = "panelFieldOptions"; this.panelFieldOptions.Size = new System.Drawing.Size(400, 300); this.panelFieldOptions.TabIndex = 0; // // userControlExample // this.userControlExample.Dock = System.Windows.Forms.DockStyle.Bottom; this.userControlExample.Location = new System.Drawing.Point(0, 270); this.userControlExample.Name = "userControlExample"; this.userControlExample.Size = new System.Drawing.Size(400, 30); this.userControlExample.TabIndex = 1; // // btnSaveField // this.btnSaveField.Image = global::RandomDataGenerator.Gui.Properties.Resources.disk; this.btnSaveField.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.btnSaveField.Location = new System.Drawing.Point(279, 14); this.btnSaveField.Name = "btnSaveField"; this.btnSaveField.Size = new System.Drawing.Size(82, 24); this.btnSaveField.TabIndex = 3; this.btnSaveField.Text = "Save Field"; this.btnSaveField.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.btnSaveField.UseVisualStyleBackColor = true; this.btnSaveField.Click += new System.EventHandler(this.btnSaveField_Click); // // boxFieldType // this.boxFieldType.Controls.Add(this.lblSubType); this.boxFieldType.Controls.Add(this.cmbSubFields); this.boxFieldType.Controls.Add(this.lblType); this.boxFieldType.Controls.Add(this.cmbFields); this.boxFieldType.Location = new System.Drawing.Point(10, 59); this.boxFieldType.Name = "boxFieldType"; this.boxFieldType.Size = new System.Drawing.Size(420, 78); this.boxFieldType.TabIndex = 2; this.boxFieldType.TabStop = false; this.boxFieldType.Text = "Field Type"; // // lblSubType // this.lblSubType.AutoSize = true; this.lblSubType.Location = new System.Drawing.Point(200, 20); this.lblSubType.Name = "lblSubType"; this.lblSubType.Size = new System.Drawing.Size(50, 13); this.lblSubType.TabIndex = 3; this.lblSubType.Text = "SubType"; // // cmbSubFields // this.cmbSubFields.DisplayMember = "Name"; this.cmbSubFields.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbSubFields.Location = new System.Drawing.Point(203, 36); this.cmbSubFields.Name = "cmbSubFields"; this.cmbSubFields.Size = new System.Drawing.Size(121, 21); this.cmbSubFields.TabIndex = 2; this.cmbSubFields.ValueMember = "SubFieldType"; this.cmbSubFields.SelectedValueChanged += new System.EventHandler(this.cmbSubFields_SelectedValueChanged); // // lblType // this.lblType.AutoSize = true; this.lblType.Location = new System.Drawing.Point(7, 20); this.lblType.Name = "lblType"; this.lblType.Size = new System.Drawing.Size(31, 13); this.lblType.TabIndex = 1; this.lblType.Text = "Type"; // // cmbFields // this.cmbFields.DisplayMember = "Name"; this.cmbFields.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbFields.Location = new System.Drawing.Point(10, 36); this.cmbFields.Name = "cmbFields"; this.cmbFields.Size = new System.Drawing.Size(121, 21); this.cmbFields.TabIndex = 0; this.cmbFields.ValueMember = "FieldType"; // this.cmbFields.SelectedValueChanged += new System.EventHandler(this.cmbFields_SelectedValueChanged); // // txtFieldName // this.txtFieldName.Location = new System.Drawing.Point(73, 16); this.txtFieldName.Name = "txtFieldName"; this.txtFieldName.Size = new System.Drawing.Size(200, 20); this.txtFieldName.TabIndex = 1; // // lblFieldName // this.lblFieldName.AutoSize = true; this.lblFieldName.Location = new System.Drawing.Point(7, 20); this.lblFieldName.Name = "lblFieldName"; this.lblFieldName.Size = new System.Drawing.Size(60, 13); this.lblFieldName.TabIndex = 0; this.lblFieldName.Text = "Field Name"; // // tabOutput // this.tabOutput.Controls.Add(this.btnGenerate); this.tabOutput.Controls.Add(this.boxOutputOptions); this.tabOutput.Controls.Add(this.boxOutputType); this.tabOutput.Location = new System.Drawing.Point(4, 22); this.tabOutput.Name = "tabOutput"; this.tabOutput.Padding = new System.Windows.Forms.Padding(3); this.tabOutput.Size = new System.Drawing.Size(704, 583); this.tabOutput.TabIndex = 1; this.tabOutput.Text = "Output"; this.tabOutput.UseVisualStyleBackColor = true; // // btnGenerate // this.btnGenerate.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", this, "ListHasItems", true)); this.btnGenerate.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnGenerate.Location = new System.Drawing.Point(8, 377); this.btnGenerate.Name = "btnGenerate"; this.btnGenerate.Size = new System.Drawing.Size(150, 50); this.btnGenerate.TabIndex = 3; this.btnGenerate.Text = "Generate!"; this.btnGenerate.UseVisualStyleBackColor = true; this.btnGenerate.Click += new System.EventHandler(this.ClickGenerate); // // boxOutputOptions // this.boxOutputOptions.Controls.Add(this.panelOutput); this.boxOutputOptions.Controls.Add(this.btnBrowseFile); this.boxOutputOptions.Controls.Add(this.txtOutputFile); this.boxOutputOptions.Controls.Add(this.lblOutputFile); this.boxOutputOptions.Controls.Add(this.numTotalRecords); this.boxOutputOptions.Controls.Add(this.lblNumRecords); this.boxOutputOptions.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", this, "ListHasItems", true)); this.boxOutputOptions.Location = new System.Drawing.Point(7, 62); this.boxOutputOptions.Name = "boxOutputOptions"; this.boxOutputOptions.Size = new System.Drawing.Size(680, 300); this.boxOutputOptions.TabIndex = 1; this.boxOutputOptions.TabStop = false; this.boxOutputOptions.Text = "Output Options"; // // panelOutput // this.panelOutput.Location = new System.Drawing.Point(2, 79); this.panelOutput.Name = "panelOutput"; this.panelOutput.Size = new System.Drawing.Size(660, 210); this.panelOutput.TabIndex = 5; // // btnBrowseFile // this.btnBrowseFile.Image = ((System.Drawing.Image)(resources.GetObject("btnBrowseFile.Image"))); this.btnBrowseFile.Location = new System.Drawing.Point(563, 49); this.btnBrowseFile.Name = "btnBrowseFile"; this.btnBrowseFile.Size = new System.Drawing.Size(24, 22); this.btnBrowseFile.TabIndex = 4; this.btnBrowseFile.UseVisualStyleBackColor = true; this.btnBrowseFile.Click += new System.EventHandler(this.ClickBrowseFile); // // txtOutputFile // this.txtOutputFile.Location = new System.Drawing.Point(120, 50); this.txtOutputFile.Name = "txtOutputFile"; this.txtOutputFile.Size = new System.Drawing.Size(440, 20); this.txtOutputFile.TabIndex = 3; this.txtOutputFile.Text = "c:\\Temp\\output.sql"; // // lblOutputFile // this.lblOutputFile.AutoSize = true; this.lblOutputFile.Location = new System.Drawing.Point(8, 53); this.lblOutputFile.Name = "lblOutputFile"; this.lblOutputFile.Size = new System.Drawing.Size(58, 13); this.lblOutputFile.TabIndex = 2; this.lblOutputFile.Text = "Output File"; // // numTotalRecords // this.numTotalRecords.Location = new System.Drawing.Point(120, 18); this.numTotalRecords.Maximum = new decimal(new int[] { 100000, 0, 0, 0}); this.numTotalRecords.Name = "numTotalRecords"; this.numTotalRecords.RightToLeft = System.Windows.Forms.RightToLeft.No; this.numTotalRecords.Size = new System.Drawing.Size(60, 20); this.numTotalRecords.TabIndex = 1; this.numTotalRecords.Value = new decimal(new int[] { 1000, 0, 0, 0}); // // lblNumRecords // this.lblNumRecords.AutoSize = true; this.lblNumRecords.Location = new System.Drawing.Point(8, 20); this.lblNumRecords.Name = "lblNumRecords"; this.lblNumRecords.Size = new System.Drawing.Size(99, 13); this.lblNumRecords.TabIndex = 0; this.lblNumRecords.Text = "Number of Records"; // // boxOutputType // this.boxOutputType.Controls.Add(this.rbOutputSQL); this.boxOutputType.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", this, "ListHasItems", true)); this.boxOutputType.Location = new System.Drawing.Point(8, 6); this.boxOutputType.Name = "boxOutputType"; this.boxOutputType.Size = new System.Drawing.Size(680, 49); this.boxOutputType.TabIndex = 0; this.boxOutputType.TabStop = false; this.boxOutputType.Text = "Output Type"; // // rbOutputSQL // this.rbOutputSQL.AutoSize = true; this.rbOutputSQL.Checked = true; this.rbOutputSQL.Location = new System.Drawing.Point(8, 20); this.rbOutputSQL.Name = "rbOutputSQL"; this.rbOutputSQL.Size = new System.Drawing.Size(46, 17); this.rbOutputSQL.TabIndex = 0; this.rbOutputSQL.TabStop = true; this.rbOutputSQL.Text = "SQL"; this.rbOutputSQL.UseVisualStyleBackColor = true; // // statusStrip // this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripStatusLabel1}); this.statusStrip.Location = new System.Drawing.Point(0, 599); this.statusStrip.Name = "statusStrip"; this.statusStrip.Size = new System.Drawing.Size(704, 22); this.statusStrip.TabIndex = 2; this.statusStrip.Text = "statusStrip1"; // // toolStripStatusLabel1 // this.toolStripStatusLabel1.Name = "toolStripStatusLabel1"; this.toolStripStatusLabel1.Size = new System.Drawing.Size(0, 17); // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.Control; this.ClientSize = new System.Drawing.Size(704, 621); this.Controls.Add(this.statusStrip); this.Controls.Add(this.tabTotal); this.Controls.Add(this.menuStrip); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MainMenuStrip = this.menuStrip; this.MaximizeBox = false; this.MaximumSize = new System.Drawing.Size(720, 660); this.Name = "MainForm"; this.Text = "RandomDataGenerator x.x.x.x"; this.menuStrip.ResumeLayout(false); this.menuStrip.PerformLayout(); this.tabTotal.ResumeLayout(false); this.tabFields.ResumeLayout(false); this.tabFields.PerformLayout(); this.boxDetials.ResumeLayout(false); this.boxDetials.PerformLayout(); this.boxOptions.ResumeLayout(false); this.panelFieldOptions.ResumeLayout(false); this.boxFieldType.ResumeLayout(false); this.boxFieldType.PerformLayout(); this.tabOutput.ResumeLayout(false); this.boxOutputOptions.ResumeLayout(false); this.boxOutputOptions.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numTotalRecords)).EndInit(); this.boxOutputType.ResumeLayout(false); this.boxOutputType.PerformLayout(); this.statusStrip.ResumeLayout(false); this.statusStrip.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.MenuStrip menuStrip; private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; private System.Windows.Forms.TabControl tabTotal; private System.Windows.Forms.TabPage tabFields; private System.Windows.Forms.TabPage tabOutput; private System.Windows.Forms.ListBox listBoxFields; private System.Windows.Forms.GroupBox boxDetials; private System.Windows.Forms.Label lblFields; private System.Windows.Forms.Button btnSaveField; private System.Windows.Forms.GroupBox boxFieldType; private System.Windows.Forms.TextBox txtFieldName; private System.Windows.Forms.Label lblFieldName; private System.Windows.Forms.Label lblType; private System.Windows.Forms.ComboBox cmbFields; private System.Windows.Forms.ComboBox cmbSubFields; private System.Windows.Forms.Label lblSubType; private System.Windows.Forms.GroupBox boxOptions; private System.Windows.Forms.Button btnAddField; private System.Windows.Forms.Button btnDeleteField; private System.Windows.Forms.Button btnUp; private System.Windows.Forms.Button btnDown; private System.Windows.Forms.Panel panelFieldOptions; private UserControls.UserControlExample userControlExample; private System.Windows.Forms.GroupBox boxOutputOptions; private System.Windows.Forms.Button btnBrowseFile; private System.Windows.Forms.TextBox txtOutputFile; private System.Windows.Forms.Label lblOutputFile; private System.Windows.Forms.NumericUpDown numTotalRecords; private System.Windows.Forms.Label lblNumRecords; private System.Windows.Forms.GroupBox boxOutputType; private System.Windows.Forms.RadioButton rbOutputSQL; private System.Windows.Forms.Panel panelOutput; private System.Windows.Forms.Button btnGenerate; private System.Windows.Forms.Label lblHiddenId; private System.Windows.Forms.StatusStrip statusStrip; private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1; private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem loadToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; } } ======================= File: src/RandomDataGenerator.Gui/UserControls/IUserControl.cs ======================= <filename>src/RandomDataGenerator.Gui/UserControls/IUserControl.cs using RandomDataGenerator.FieldOptions; namespace RandomDataGenerator.Gui.UserControls { public interface IUserControl { void SetOptions(FieldOptionsAbstract options); FieldOptionsAbstract GetFieldOptions(); void UpdateControls(FieldOptionsAbstract options); } public interface IUserControl<TOptions> { TOptions GetFieldOptionsT(); void SetOptionsAndUpdateControls(TOptions options); } } ======================= File: src/RandomDataGenerator/FieldOptions/FieldOptionsDateTime.cs ======================= using System; namespace RandomDataGenerator.FieldOptions { public class FieldOptionsDateTime : FieldOptionsAbstract, IFieldOptionsDateTime { public const string DefaultFormat = "s"; // "s" -> sortable date/time pattern public string Format { get; set; } = DefaultFormat; public DateTime From { get; set; } = DateTime.UtcNow.Date; public DateTime To { get; set; } = DateTime.UtcNow.Date.AddYears(1); public bool IncludeTime { get; set; } = true; } } ======================= File: src/RandomDataGenerator.Gui/UserControlsFields/UserControlLastName.cs ======================= using System; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Gui.UserControls; namespace RandomDataGenerator.Gui.UserControlsFields { public sealed partial class UserControlLastName : UserControlLastNameDesignable { public UserControlLastName() { InitializeComponent(); OnOptionsChanged(EventArgs.Empty); } } // Workaround http://stackoverflow.com/questions/677609/generic-base-class-for-winform-usercontrol public class UserControlLastNameDesignable : BaseUserControl<FieldOptionsLastName> { } } ======================= File: src/RandomDataGenerator.Gui/UserControlsFields/UserControlTextPattern.cs ======================= using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Gui.UserControls; namespace RandomDataGenerator.Gui.UserControlsFields { public sealed partial class UserControlTextPattern : UserControlTextPatternDesignable { public UserControlTextPattern() { InitializeComponent(); InitEventsForControls(); } public override void SetOptionsAndUpdateControls(FieldOptionsTextPattern options) { base.SetOptionsAndUpdateControls(options); txtPattern.Text = FieldOptions.Pattern; //chkLetter.Checked = FieldOptions.UseLetter; //chkSpace.Checked = FieldOptions.UseSpace; //chkSpecial.Checked = FieldOptions.UseSpecial; //chkNumber.Checked = FieldOptions.UseNumber; //if (FieldOptions.UseLowercase && FieldOptions.UseUppercase) //{ // rbBoth.Checked = true; //} //else //{ // rbUpper.Checked = FieldOptions.UseUppercase; // rbLower.Checked = FieldOptions.UseLowercase; //} } public override FieldOptionsTextPattern GetFieldOptionsT() { FieldOptions = base.GetFieldOptionsT(); FieldOptions.Pattern = txtPattern.Text; //FieldOptions.UseLowercase = rbLower.Checked; //FieldOptions.UseUppercase = rbUpper.Checked; //FieldOptions.UseLetter = chkLetter.Checked; //FieldOptions.UseNumber = chkNumber.Checked; //FieldOptions.UseSpecial = chkSpecial.Checked; //FieldOptions.UseSpace = chkSpace.Checked; return FieldOptions; } } // Workaround http://stackoverflow.com/questions/677609/generic-base-class-for-winform-usercontrol public class UserControlTextPatternDesignable : BaseUserControl<FieldOptionsTextPattern> { } } ======================= File: src/RandomDataGenerator.Gui/Project/ProjectSettings.cs ======================= <gh_stars>10-100 using System; using System.Collections.Generic; using RandomDataGenerator.Gui.Entities; using RandomDataGenerator.Gui.Generation; namespace RandomDataGenerator.Gui.Project { public class ProjectSettings { public DateTime Date { get; set; } public string Name { get; set; } public int TotalRecords { get; set; } public string OutputFile { get; set; } public BaseGenerateOptions GenerateOptions { get; set; } public List<DataField> DataFields { get; set; } } } ======================= File: src/RandomDataGenerator/Extensions/StringExtensions.cs ======================= namespace RandomDataGenerator.Extensions { internal static class StringExtensions { public static string ToCasedInvariant(this string str, bool toUpper) { if (str == null) { return null; } return toUpper? str.ToUpperInvariant() : str.ToLowerInvariant(); } } } ======================= File: src/RandomDataGenerator.Gui/Extensions/ListBoxExtensions.cs ======================= using System.Windows.Forms; using RandomDataGenerator.Gui.Entities; namespace RandomDataGenerator.Gui.Extensions { public class ListBoxObjectFindresult<T> { public T Item { get; internal set; } public int Index { get; internal set; } } public static class ListBoxExtensions { public static ListBoxObjectFindresult<T> FindItem<T>(this ListBox listBox, string id) where T : IListItem { for (int i = 0; i < listBox.Items.Count; i++) { if (listBox.Items[i] is T) { var existingDataField = (T)listBox.Items[i]; if (existingDataField.Id == id) { return new ListBoxObjectFindresult<T> { Item = existingDataField, Index = i }; } } } return null; } } } ======================= File: src/RandomDataGenerator.Gui/UserControlsFields/UserControlInteger.Designer.cs ======================= using System; namespace RandomDataGenerator.Gui.UserControlsFields { sealed partial class UserControlInteger { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components!= null)) { components.Dispose(); } base.Dispose(disposing); } #region Component Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.lblIntegerMin = new System.Windows.Forms.Label(); this.lblIntegerMax = new System.Windows.Forms.Label(); this.ctrlMin = new System.Windows.Forms.NumericUpDown(); this.ctrlMax = new System.Windows.Forms.NumericUpDown(); this.lblConvertToString = new System.Windows.Forms.Label(); this.chkConvertToString = new System.Windows.Forms.CheckBox(); ((System.ComponentModel.ISupportInitialize)(this.ctrlMin)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.ctrlMax)).BeginInit(); this.SuspendLayout(); // // lblIntegerMin // this.lblIntegerMin.AutoSize = true; this.lblIntegerMin.Location = new System.Drawing.Point(4, 6); this.lblIntegerMin.Name = "lblIntegerMin"; this.lblIntegerMin.Size = new System.Drawing.Size(48, 13); this.lblIntegerMin.TabIndex = 0; this.lblIntegerMin.Text = "Minimum"; // // lblIntegerMax // this.lblIntegerMax.AutoSize = true; this.lblIntegerMax.Location = new System.Drawing.Point(4, 40); this.lblIntegerMax.Name = "lblIntegerMax"; this.lblIntegerMax.Size = new System.Drawing.Size(51, 13); this.lblIntegerMax.TabIndex = 2; this.lblIntegerMax.Text = "Maximum"; // // ctrlMin // this.ctrlMin.Location = new System.Drawing.Point(108, 4); this.ctrlMin.Maximum = new decimal(new int[] { Int32.MaxValue, 0, 0, 0}); this.ctrlMin.Name = "ctrlMin"; this.ctrlMin.Size = new System.Drawing.Size(75, 20); this.ctrlMin.TabIndex = 1; this.ctrlMin.ValueChanged += new System.EventHandler(this.MinValueChanged); // // ctrlMax // this.ctrlMax.Location = new System.Drawing.Point(108, 38); this.ctrlMax.Maximum = new decimal(new int[] { Int32.MaxValue, 0, 0, 0}); this.ctrlMax.Name = "ctrlMax"; this.ctrlMax.Size = new System.Drawing.Size(75, 20); this.ctrlMax.TabIndex = 3; this.ctrlMax.Value = new decimal(new int[] { Int32.MaxValue, 0, 0, 0}); this.ctrlMax.ValueChanged += new System.EventHandler(this.MaxValueChanged); // // lblConvertToString // this.lblConvertToString.AutoSize = true; this.lblConvertToString.Location = new System.Drawing.Point(4, 72); this.lblConvertToString.Name = "lblConvertToString"; this.lblConvertToString.Size = new System.Drawing.Size(84, 13); this.lblConvertToString.TabIndex = 4; this.lblConvertToString.Text = "Convert to string"; // // chkConvertToString // this.chkConvertToString.AutoSize = true; this.chkConvertToString.Location = new System.Drawing.Point(108, 72); this.chkConvertToString.Name = "chkConvertToString"; this.chkConvertToString.Size = new System.Drawing.Size(15, 14); this.chkConvertToString.TabIndex = 5; this.chkConvertToString.UseVisualStyleBackColor = true; // // UserControlInteger // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.chkConvertToString); this.Controls.Add(this.lblConvertToString); this.Controls.Add(this.ctrlMax); this.Controls.Add(this.ctrlMin); this.Controls.Add(this.lblIntegerMax); this.Controls.Add(this.lblIntegerMin); this.Name = "UserControlInteger"; this.Size = new System.Drawing.Size(350, 120); ((System.ComponentModel.ISupportInitialize)(this.ctrlMin)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.ctrlMax)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.Label lblIntegerMin; private System.Windows.Forms.Label lblIntegerMax; private System.Windows.Forms.NumericUpDown ctrlMin; private System.Windows.Forms.NumericUpDown ctrlMax; private System.Windows.Forms.Label lblConvertToString; private System.Windows.Forms.CheckBox chkConvertToString; } } ======================= File: src/RandomDataGenerator.Gui/UserControls/UserControlOutputSQL.Designer.cs ======================= <reponame>brunotarghetta/RandomDataGenerator namespace RandomDataGenerator.Gui.UserControls { public partial class UserControlOutputSQL { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components!= null)) { components.Dispose(); } base.Dispose(disposing); } #region Component Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.lblTableName = new System.Windows.Forms.Label(); this.txtTableName = new System.Windows.Forms.TextBox(); this.lblRecordsPerInsert = new System.Windows.Forms.Label(); this.numRecordsPerInsert = new System.Windows.Forms.NumericUpDown(); this.boxInsertOperation = new System.Windows.Forms.GroupBox(); this.rbInsert = new System.Windows.Forms.RadioButton(); this.chkIncludeFieldNames = new System.Windows.Forms.CheckBox(); ((System.ComponentModel.ISupportInitialize)(this.numRecordsPerInsert)).BeginInit(); this.boxInsertOperation.SuspendLayout(); this.SuspendLayout(); // // lblTableName // this.lblTableName.AutoSize = true; this.lblTableName.Location = new System.Drawing.Point(4, 7); this.lblTableName.Name = "lblTableName"; this.lblTableName.Size = new System.Drawing.Size(65, 13); this.lblTableName.TabIndex = 0; this.lblTableName.Text = "Table Name"; // // txtTableName // this.txtTableName.Location = new System.Drawing.Point(118, 4); this.txtTableName.Name = "txtTableName"; this.txtTableName.Size = new System.Drawing.Size(200, 20); this.txtTableName.TabIndex = 1; this.txtTableName.Text = "My Table"; // // lblRecordsPerInsert // this.lblRecordsPerInsert.AutoSize = true; this.lblRecordsPerInsert.Location = new System.Drawing.Point(4, 40); this.lblRecordsPerInsert.Name = "lblRecordsPerInsert"; this.lblRecordsPerInsert.Size = new System.Drawing.Size(94, 13); this.lblRecordsPerInsert.TabIndex = 2; this.lblRecordsPerInsert.Text = "Records per Insert"; // // numRecordsPerInsert // this.numRecordsPerInsert.Location = new System.Drawing.Point(118, 38); this.numRecordsPerInsert.Minimum = new decimal(new int[] { 1, 0, 0, 0}); this.numRecordsPerInsert.Name = "numRecordsPerInsert"; this.numRecordsPerInsert.Size = new System.Drawing.Size(40, 20); this.numRecordsPerInsert.TabIndex = 3; this.numRecordsPerInsert.Value = new decimal(new int[] { 10, 0, 0, 0}); // // boxInsertOperation // this.boxInsertOperation.Controls.Add(this.rbInsert); this.boxInsertOperation.Location = new System.Drawing.Point(11, 71); this.boxInsertOperation.Name = "boxInsertOperation"; this.boxInsertOperation.Size = new System.Drawing.Size(147, 100); this.boxInsertOperation.TabIndex = 4; this.boxInsertOperation.TabStop = false; this.boxInsertOperation.Text = "Insert Operation"; // // rbInsert // this.rbInsert.AutoSize = true; this.rbInsert.Checked = true; this.rbInsert.Location = new System.Drawing.Point(7, 20); this.rbInsert.Name = "rbInsert"; this.rbInsert.Size = new System.Drawing.Size(65, 17); this.rbInsert.TabIndex = 0; this.rbInsert.TabStop = true; this.rbInsert.Text = "INSERT"; this.rbInsert.UseVisualStyleBackColor = true; // // chkIncludeFieldNames // this.chkIncludeFieldNames.AutoSize = true; this.chkIncludeFieldNames.Checked = true; this.chkIncludeFieldNames.CheckState = System.Windows.Forms.CheckState.Checked; this.chkIncludeFieldNames.Location = new System.Drawing.Point(11, 177); this.chkIncludeFieldNames.Name = "chkIncludeFieldNames"; this.chkIncludeFieldNames.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.chkIncludeFieldNames.Size = new System.Drawing.Size(122, 17); this.chkIncludeFieldNames.TabIndex = 5; this.chkIncludeFieldNames.Text = "Include Field Names"; this.chkIncludeFieldNames.UseVisualStyleBackColor = true; // // UserControlOutputSQL // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.chkIncludeFieldNames); this.Controls.Add(this.boxInsertOperation); this.Controls.Add(this.numRecordsPerInsert); this.Controls.Add(this.lblRecordsPerInsert); this.Controls.Add(this.txtTableName); this.Controls.Add(this.lblTableName); this.Name = "UserControlOutputSQL"; this.Size = new System.Drawing.Size(600, 200); ((System.ComponentModel.ISupportInitialize)(this.numRecordsPerInsert)).EndInit(); this.boxInsertOperation.ResumeLayout(false); this.boxInsertOperation.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.Label lblTableName; private System.Windows.Forms.Label lblRecordsPerInsert; private System.Windows.Forms.GroupBox boxInsertOperation; private System.Windows.Forms.RadioButton rbInsert; private System.Windows.Forms.CheckBox chkIncludeFieldNames; private System.Windows.Forms.TextBox txtTableName; private System.Windows.Forms.NumericUpDown numRecordsPerInsert; } } ======================= File: src/RandomDataGenerator.Gui/UserControlsFields/UserControlTextWords.cs ======================= <gh_stars>10-100 using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Gui.UserControls; namespace RandomDataGenerator.Gui.UserControlsFields { public partial class UserControlTextWords : BaseUserControl<FieldOptionsTextWords> //UserControlTextWordsDesignable { public UserControlTextWords() { InitializeComponent(); InitEventsForControls(); } public sealed override void SetOptionsAndUpdateControls(FieldOptionsTextWords options) { base.SetOptionsAndUpdateControls(options); ctrlMin.Value = FieldOptions.Min; ctrlMax.Value = FieldOptions.Max; } public override FieldOptionsTextWords GetFieldOptionsT() { FieldOptions = base.GetFieldOptionsT(); FieldOptions.Min = (int)ctrlMin.Value; FieldOptions.Max = (int)ctrlMax.Value; return FieldOptions; } private void EventValueChangedMin(object sender, System.EventArgs e) { ctrlMax.Minimum = ctrlMin.Value; } private void EventValueChangedMax(object sender, System.EventArgs e) { ctrlMin.Maximum = ctrlMax.Value; } } } ======================= File: src/RandomDataGenerator/Randomizers/IRandomizerDateTime.cs ======================= <filename>src/RandomDataGenerator/Randomizers/IRandomizerDateTime.cs using System; namespace RandomDataGenerator.Randomizers { public interface IRandomizerDateTime { DateTime? Generate(); string GenerateAsString(); } } ======================= File: src/RandomDataGenerator/Randomizers/IRandomizerNumber.cs ======================= <reponame>brunotarghetta/RandomDataGenerator namespace RandomDataGenerator.Randomizers { public interface IRandomizerNumber<T> where T : struct { T? Generate(); } } ======================= File: src/RandomDataGenerator/FieldOptions/FieldOptionsShort.cs ======================= namespace RandomDataGenerator.FieldOptions { public class FieldOptionsShort : FieldOptionsNumber<short> { public override short Min { get; set; } public override short Max { get; set; } = short.MaxValue; } } ======================= File: src/RandomDataGenerator.Gui/UserControlsFields/UserControlDateTime.cs ======================= <reponame>brunotarghetta/RandomDataGenerator<gh_stars>10-100 using System; using System.ComponentModel; using System.Windows.Forms; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Gui.UserControls; namespace RandomDataGenerator.Gui.UserControlsFields { public sealed partial class UserControlDateTime : UserControlDateTimeDesignable, INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; public UserControlDateTime() { InitializeComponent(); InitEventsForControls(); } public override void SetOptionsAndUpdateControls(FieldOptionsDateTime options) { base.SetOptionsAndUpdateControls(options); datePickerFrom.Value = FieldOptions.From; timePickerFrom.Value = FieldOptions.IncludeTime? FieldOptions.From : DateTime.Now.Date; datePickerTo.Value = FieldOptions.To; timePickerTo.Value = FieldOptions.IncludeTime? FieldOptions.To : DateTime.Now.Date; IncludeTime = FieldOptions.IncludeTime; } public override FieldOptionsDateTime GetFieldOptionsT() { FieldOptions = base.GetFieldOptionsT(); FieldOptions.From = datePickerFrom.Value + (chkIncludeTime.Checked? timePickerFrom.Value.TimeOfDay : new TimeSpan(0)); FieldOptions.To = datePickerTo.Value + (chkIncludeTime.Checked? timePickerTo.Value.TimeOfDay : new TimeSpan(0)); FieldOptions.IncludeTime = chkIncludeTime.Checked; return FieldOptions; } // NotifyPropertyChanged will raise the PropertyChanged event passing the source property that is being updated. public void NotifyPropertyChanged(string propertyName) { if (PropertyChanged!= null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } private bool _includeTime; public bool IncludeTime { get => _includeTime; set { if (value!= _includeTime) { _includeTime = value; if (!value) { timePickerFrom.Value = DateTime.Now.Date; timePickerTo.Value = DateTime.Now.Date; } NotifyPropertyChanged("IncludeTime"); } } } private void CheckedChangedIncludeTime(object sender, EventArgs e) { var checkBox = (CheckBox)sender; IncludeTime = checkBox.Checked; } } // Workaround http://stackoverflow.com/questions/677609/generic-base-class-for-winform-usercontrol public class UserControlDateTimeDesignable : BaseUserControl<FieldOptionsDateTime> { } } ======================= File: src/RandomDataGenerator/Generators/RandomItemFromListGenerator.cs ======================= using System; using System.Collections.Generic; using System.Linq; namespace RandomDataGenerator.Generators { internal class RandomItemFromListGenerator<T> { private readonly RandomValueGenerator _randomValueGenerator; private readonly T[] _list; public RandomItemFromListGenerator(int? seed, IEnumerable<T> list, Func<T, bool> predicate = null) { _list = predicate == null? list.ToArray() : list.Where(predicate).ToArray(); _randomValueGenerator = new RandomValueGenerator(seed?? Environment.TickCount); } public T Generate() { return _list.Length > 0? _list[_randomValueGenerator.Next(0, _list.Length - 1)] : default(T); } } } ======================= File: src/RandomDataGenerator/Randomizers/RandomizerIBAN.cs ======================= using System; using System.Linq; using RandomDataGenerator.Data; using RandomDataGenerator.Data.Models; using RandomDataGenerator.Extensions; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Generators; namespace RandomDataGenerator.Randomizers { public class RandomizerIBAN : RandomizerAbstract<FieldOptionsIBAN>, IRandomizerString { private readonly RandomItemFromListGenerator<IBAN> _itemGenerator; public RandomizerIBAN(FieldOptionsIBAN options) : base(options) { Func<IBAN, bool> predicate = null; if (!string.IsNullOrEmpty(options.CountryCode)) { predicate = (iban) => iban.CountryCode == options.CountryCode; } // Set the list to IBAN as default var list = ListData.Instance.IBANs; switch (options.Type) { case "BBAN": list = ListData.Instance.BBANs; break; case "BOTH": list = list.Union(ListData.Instance.BBANs); break; } _itemGenerator = new RandomItemFromListGenerator<IBAN>(options.Seed, list, predicate); } public string Generate() { if (IsNull()) { return null; } var iban = _itemGenerator.Generate(); return iban.Generator.Generate(); } public string Generate(bool upperCase) { return Generate().ToCasedInvariant(upperCase); } } } ======================= File: src/RandomDataGenerator.Gui/UserControlsFields/UserControlIPv4Address.cs ======================= <gh_stars>10-100 using System; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Gui.UserControls; namespace RandomDataGenerator.Gui.UserControlsFields { public partial class UserControlIPv4Address : UserControlIPv4AddressDesignable { public UserControlIPv4Address() { InitializeComponent(); base.OnOptionsChanged(EventArgs.Empty); } } // Workaround http://stackoverflow.com/questions/677609/generic-base-class-for-winform-usercontrol public class UserControlIPv4AddressDesignable : BaseUserControl<FieldOptionsIPv4Address> { } } ======================= File: src/RandomDataGenerator.Gui/Generation/GenerateOptionsSQL.cs =======================  namespace RandomDataGenerator.Gui.Generation { public
66,366
thestackv1_concat_by_repo-long/65536-65536
84 xoris r0, r3, 0x8000 lfd f3, -0x4168(r2) stw r0, 0x1BC(r1) lfs f1, -0x4160(r2) stw r22, 0x1B8(r1) lfs f0, -0x40B8(r2) lfd f2, 0x1B8(r1) fsubs f2, f2, f3 fdivs f1, f2, f1 fmuls f29, f0, f1 bl 0x31E58 xoris r0, r3, 0x8000 lfd f3, -0x4168(r2) stw r0, 0x1B4(r1) lfs f1, -0x4160(r2) stw r22, 0x1B0(r1) lfs f0, -0x4174(r2) lfd f2, 0x1B0(r1) fsubs f2, f2, f3 fdivs f1, f2, f1 fmuls f30, f0, f1 bl 0x31E2C xoris r0, r3, 0x8000 lfs f0, -0x40B0(r2) stw r0, 0x1AC(r1) addi r5, r1, 0x170 fsubs f1, f0, f30 lfd f5, -0x4168(r2) stw r22, 0x1A8(r1) lfs f3, -0x4160(r2) fneg f0, f29 lfd f4, 0x1A8(r1) li r4, 0x33 lfs f2, -0x40B4(r2) li r6, 0 fsubs f4, f4, f5 lwz r3, 0x31C0(r13) li r7, 0 fdivs f3, f4, f3 fmuls f2, f2, f3 stfs f2, 0x170(r1) stfs f1, 0x174(r1) stfs f0, 0x178(r1) bl 0x38A0 .loc_0x11C: lbz r0, 0x4(r23) cmplwi r0, 0 beq- .loc_0x158 lfs f1, 0x0(r23) lfs f0, -0x4188(r2) fcmpo cr0, f1, f0 bge- .loc_0x14C li r0, 0 stb r0, 0x4(r23) lfs f0, -0x4170(r2) stfs f0, 0x0(r23) b .loc_0x158 .loc_0x14C: lfs f0, -0x4144(r2) fsubs f0, f1, f0 stfs f0, 0x0(r23) .loc_0x158: lwz r3, 0x34(r31) li r5, 0 lbz r0, 0x35(r3) cmplwi r0, 0 bne- .loc_0x17C lbz r0, 0x34(r3) cmplwi r0, 0 bne- .loc_0x17C li r5, 0x1 .loc_0x17C: lwz r23, 0x38(r31) li r22, 0 stw r22, 0x134(r23) lwz r0, 0x0(r23) cmpwi r0, 0x1 beq- .loc_0x1B4 bge- .loc_0x1D4 cmpwi r0, 0 bge- .loc_0x1A4 b .loc_0x1D4 .loc_0x1A4: addi r3, r23, 0 addi r4, r26, 0 bl -0x750 b .loc_0x1D4 .loc_0x1B4: mr r3, r23 bl -0x970 rlwinm r0,r3,0,24,31 cmplwi r0, 0x1 bne- .loc_0x1D4 stw r22, 0x0(r23) li r0, 0x40 stw r0, 0x134(r23) .loc_0x1D4: lwz r3, 0x38(r31) lwz r30, 0x134(r3) rlwinm. r0,r30,0,31,31 beq- .loc_0x2B0 lwz r26, 0x34(r31) li r4, 0 lwz r3, 0x4(r3) lbz r0, 0x35(r26) lwz r3, 0x24(r3) cmplwi r0, 0 lha r20, 0x18(r3) lha r21, 0x1A(r3) bne- .loc_0x2A8 lbz r3, 0x34(r26) cmplwi r3, 0 bne- .loc_0x218 li r4, 0x1 .loc_0x218: rlwinm. r0,r4,0,24,31 beq- .loc_0x2A8 cmplwi r3, 0 bne- .loc_0x23C lbz r0, 0x35(r26) cmplwi r0, 0 bne- .loc_0x23C li r3, 0x123 bl -0x141048 .loc_0x23C: li r0, 0x1 stw r0, 0x4(r26) lwz r0, 0x4(r26) cmpwi r0, 0x1 beq- .loc_0x268 bge- .loc_0x268 cmpwi r0, 0 bge- .loc_0x260 b .loc_0x268 .loc_0x260: lfs f0, -0x4188(r2) stfs f0, 0x30(r26) .loc_0x268: xoris r0, r20, 0x8000 lfd f2, -0x4168(r2) stw r0, 0x1AC(r1) xoris r0, r21, 0x8000 lis r3, 0x4330 stw r3, 0x1A8(r1) stw r0, 0x1B4(r1) lfd f0, 0x1A8(r1) stw r3, 0x1B0(r1) fsubs f1, f0, f2 lfd f0, 0x1B0(r1) fsubs f0, f0, f2 stfs f1, 0xC(r26) stfs f0, 0x10(r26) lfs f0, 0x2564(r13) stfs f0, 0x14(r26) .loc_0x2A8: mr r3, r31 bl 0xFC8 .loc_0x2B0: rlwinm. r0,r30,0,27,27 beq- .loc_0x2CC lwz r3, 0x70(r31) li r4, 0x1 bl -0x8E8C li r0, 0x4 stw r0, 0x4(r31) .loc_0x2CC: rlwinm. r0,r30,0,26,26 beq- .loc_0x38C lwz r3, 0x38(r31) lwz r22, 0x34(r31) lwz r3, 0x4(r3) lbz r0, 0x35(r22) lwz r3, 0x24(r3) cmplwi r0, 0 lha r20, 0x18(r3) lha r21, 0x1A(r3) bne- .loc_0x304 lbz r0, 0x34(r22) cmplwi r0, 0 beq- .loc_0x38C .loc_0x304: li r0, 0 stb r0, 0x35(r22) addi r3, r22, 0 li r4, 0 bl -0x86B0 li r0, 0x1 stw r0, 0x4(r22) lwz r0, 0x4(r22) cmpwi r0, 0x1 beq- .loc_0x344 bge- .loc_0x344 cmpwi r0, 0 bge- .loc_0x33C b .loc_0x344 .loc_0x33C: lfs f0, -0x4188(r2) stfs f0, 0x30(r22) .loc_0x344: xoris r0, r20, 0x8000 lfd f2, -0x4168(r2) stw r0, 0x1AC(r1) xoris r0, r21, 0x8000 lis r4, 0x4330 stw r4, 0x1A8(r1) li r3, 0x11D stw r0, 0x1B4(r1) lfd f0, 0x1A8(r1) stw r4, 0x1B0(r1) fsubs f1, f0, f2 lfd f0, 0x1B0(r1) fsubs f0, f0, f2 stfs f1, 0xC(r22) stfs f0, 0x10(r22) lfs f0, 0x2568(r13) stfs f0, 0x14(r22) bl -0x141198 .loc_0x38C: lwz r3, 0x34(r31) lwz r0, 0x4(r3) cmpwi r0, 0x2 bne- .loc_0x740 lwz r3, 0x38(r31) li r0, -0x1 lwz r3, 0x4(r3) cmplwi r3, 0 beq- .loc_0x3B4 lwz r0, 0x10(r3) .loc_0x3B4: stw r0, 0x8(r31) li r4, 0 lwz r3, 0x50(r31) bl 0x3790 lwz r3, 0x38(r31) lfs f0, -0x4188(r2) lwz r3, 0x4(r3) lwz r21, 0x14(r3) stfs f0, 0x100(r1) addi r3, r21, 0x18 stfs f0, 0xFC(r1) stfs f0, 0xF8(r1) bl -0x2E034 lha r20, 0x1A(r21) addi r22, r3, 0 addi r3, r21, 0x18 bl -0x2E054 lha r4, 0x18(r21) srawi r3, r3, 0x1 srawi r0, r22, 0x1 lfd f2, -0x4168(r2) add r3, r4, r3 xoris r3, r3, 0x8000 add r0, r20, r0 stw r3, 0x1AC(r1) subfic r0, r0, 0x1E0 xoris r0, r0, 0x8000 lis r22, 0x4330 stw r0, 0x1B4(r1) addi r5, r1, 0xF8 stw r22, 0x1A8(r1) li r4, 0x2D li r6, 0 stw r22, 0x1B0(r1) li r7, 0 lfd f1, 0x1A8(r1) lfd f0, 0x1B0(r1) fsubs f1, f1, f2 fsubs f0, f0, f2 stfs f1, 0xF8(r1) stfs f0, 0xFC(r1) lfs f0, 0x2600(r13) stfs f0, 0x100(r1) lwz r3, 0x31C0(r13) bl 0x3554 lwz r25, 0x58(r31) addi r30, r1, 0xD8 lfs f29, -0x4188(r2) addi r29, r1, 0xD4 lfs f30, -0x4154(r2) lfd f31, -0x4168(r2) addi r26, r25, 0 addi r28, r1, 0xE0 addi r27, r1, 0xDC li r21, 0 .loc_0x490: lfs f0, 0x10(r26) addi r20, r26, 0xC fcmpo cr0, f0, f29 cror 2, 0x1, 0x2 bne- .loc_0x4AC fadds f0, f30, f0 b .loc_0x4B0 .loc_0x4AC: fsubs f0, f0, f30 .loc_0x4B0: lfs f1, 0x0(r20) fctiwz f0, f0 fcmpo cr0, f1, f29 stfd f0, 0x1A8(r1) lwz r23, 0x1AC(r1) cror 2, 0x1, 0x2 bne- .loc_0x4D4 fadds f0, f30, f1 b .loc_0x4D8 .loc_0x4D4: fsubs f0, f1, f30 .loc_0x4D8: fctiwz f0, f0 lwz r3, 0x24(r20) addi r3, r3, 0x18 stfd f0, 0x1A8(r1) lwz r24, 0x1AC(r1) bl -0x2E14C lwz r4, 0x24(r20) srawi r0, r3, 0x1 sub r24, r24, r0 addi r3, r4, 0x18 bl -0x2E150 srawi r0, r3, 0x1 lwz r3, 0x24(r20) sub r23, r23, r0 lwz r12, 0x0(r3) addi r4, r24, 0 addi r5, r23, 0 lwz r12, 0x14(r12) mtlr r12 blrl xoris r23, r23, 0x8000 xoris r24, r24, 0x8000 stw r23, 0x1B4(r1) mr r4, r29 stw r24, 0x1BC(r1) addi r5, r30, 0 addi r3, r20, 0xC stw r22, 0x1B0(r1) addi r6, r13, 0x25EC stw r22, 0x1B8(r1) lfd f1, 0x1B0(r1) lfd f0, 0x1B8(r1) fsubs f1, f1, f31 fsubs f0, f0, f31 stfs f1, 0xD8(r1) stfs f0, 0xD4(r1) bl -0x189060 stw r23, 0x1A4(r1) addi r4, r27, 0 addi r5, r28, 0 stw r24, 0x19C(r1) addi r3, r20, 0x18 addi r6, r13, 0x25F0 stw r22, 0x1A0(r1) stw r22, 0x198(r1) lfd f1, 0x1A0(r1) lfd f0, 0x198(r1) fsubs f1, f1, f31 fsubs f0, f0, f31 stfs f1, 0xE0(r1) stfs f0, 0xDC(r1) bl -0x18909C addi r21, r21, 0x1 cmpwi r21, 0x4 addi r26, r26, 0x28 blt+ .loc_0x490 li r0, 0 stw r0, 0x0(r25) li r0, 0x2 mtctr r0 lis r3, 0x4330 lwz r7, 0x58(r31) lfs f0, -0x4188(r2) mr r9, r7 stfs f0, 0x4(r7) lfs f0, -0x4154(r2) stfs f0, 0x8(r7) lfd f3, -0x4168(r2) .loc_0x5E8: lwz r5, 0x30(r9) lha r0, 0x18(r5) lha r10, 0x1A(r5) xoris r0, r0, 0x8000 lha r4, 0x1E(r5) stw r0, 0x19C(r1) xoris r0, r10, 0x8000 lha r6, 0x18(r5) sub r4, r4, r10 stw r3, 0x198(r1) lha r5, 0x1C(r5) stw r0, 0x1A4(r1) sub r0, r5, r6 lfd f0, 0x198(r1) srawi r0, r0, 0x1 stw r3, 0x1A0(r1) subfic r0, r0, 0x140 fsubs f2, f0, f3 lfd f0, 0x1A0(r1) xoris r0, r0, 0x8000 stw r0, 0x1AC(r1) srawi r4, r4, 0x1 subfic r0, r4, 0xF0 fsubs f1, f0, f3 xoris r0, r0, 0x8000 stfs f2, 0x18(r9) stw r3, 0x1A8(r1) stw r0, 0x1B4(r1) lfd f0, 0x1A8(r1) stfs f1, 0x1C(r9) fsubs f1, f0, f3 stw r3, 0x1B0(r1) lfs f2, 0x25F4(r13) lfd f0, 0x1B0(r1) stfs f2, 0x20(r9) fsubs f0, f0, f3 stfs f1, 0x24(r9) stfs f0, 0x28(r9) lfs f0, 0x25F8(r13) stfs f0, 0x2C(r9) lwz r5, 0x58(r9) lha r0, 0x18(r5) lha r10, 0x1A(r5) xoris r0, r0, 0x8000 lha r4, 0x1E(r5) stw r0, 0x19C(r1) xoris r0, r10, 0x8000 lha r6, 0x18(r5) sub r4, r4, r10 stw r3, 0x198(r1) lha r5, 0x1C(r5) stw r0, 0x1A4(r1) sub r0, r5, r6 lfd f0, 0x198(r1) srawi r0, r0, 0x1 stw r3, 0x1A0(r1) subfic r0, r0, 0x140 fsubs f2, f0, f3 lfd f0, 0x1A0(r1) xoris r0, r0, 0x8000 stw r0, 0x1AC(r1) srawi r4, r4, 0x1 subfic r0, r4, 0xF0 fsubs f1, f0, f3 xoris r0, r0, 0x8000 stfs f2, 0x40(r9) stw r3, 0x1A8(r1) stw r0, 0x1B4(r1) lfd f0, 0x1A8(r1) stfs f1, 0x44(r9) fsubs f1, f0, f3 stw r3, 0x1B0(r1) lfs f2, 0x25F4(r13) lfd f0, 0x1B0(r1) stfs f2, 0x48(r9) fsubs f0, f0, f3 stfs f1, 0x4C(r9) stfs f0, 0x50(r9) lfs f0, 0x25F8(r13) stfs f0, 0x54(r9) addi r9, r9, 0x50 bdnz+ .loc_0x5E8 li r0, 0x1 stw r0, 0x0(r7) li r25, 0x1 stb r0, 0xAC(r7) .loc_0x740: lwz r22, 0x34(r31) lwz r0, 0x4(r22) cmpwi r0, 0x1 beq- .loc_0x770 bge- .loc_0x800 cmpwi r0, 0 bge- .loc_0x764 b .loc_0x800 b .loc_0x800 .loc_0x764: mr r3, r22 bl -0x5F68 b .loc_0x800 .loc_0x770: mr r3, r22 bl -0x6408 rlwinm. r0,r3,0,24,31 beq- .loc_0x800 lbz r0, 0x35(r22) cmplwi r0, 0 beq- .loc_0x798 mr r3, r22 bl -0x64F4 b .loc_0x800 .loc_0x798: lbz r0, 0x34(r22) cmplwi r0, 0 beq- .loc_0x7D4 li r0, 0x2 stw r0, 0x4(r22) lwz r0, 0x4(r22) cmpwi r0, 0x1 beq- .loc_0x800 bge- .loc_0x800 cmpwi r0, 0 bge- .loc_0x7C8 b .loc_0x800 .loc_0x7C8: lfs f0, -0x4188(r2) stfs f0, 0x30(r22) b .loc_0x800 .loc_0x7D4: li r0, 0 stw r0, 0x4(r22) lwz r0, 0x4(r22) cmpwi r0, 0x1 beq- .loc_0x800 bge- .loc_0x800 cmpwi r0, 0 bge- .loc_0x7F8 b .loc_0x800 .loc_0x7F8: lfs f0, -0x4188(r2) stfs f0, 0x30(r22) .loc_0x800: mr r3, r22 bl -0x68B8 li r20, 0 mulli r0, r20, 0x3C add r21, r22, r0 .loc_0x814: lwz r4, 0x8(r22) addi r3, r21, 0x44 addi r4, r4, 0xC0 bl -0x6EFC addi r20, r20, 0x1 cmpwi r20, 0x3 addi r21, r21, 0x3C blt+ .loc_0x814 mr r3, r22 bl -0x726C mr r3, r31 bl 0x958 mr r3, r25 lmw r20, 0x1C0(r1) lwz r0, 0x20C(r1) lfd f31, 0x200(r1) lfd f30, 0x1F8(r1) lfd f29, 0x1F0(r1) addi r1, r1, 0x208 mtlr r0 blr */ } /* * --INFO-- * Address: 801E69EC * Size: 000614 */ void zen::DrawWorldMap::modeConfirm(Controller*) { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) stwu r1, -0x128(r1) stfd f31, 0x120(r1) stmw r26, 0x108(r1) mr r31, r3 lwz r28, 0x70(r3) lwz r0, 0x74(r28) cmpwi r0, 0x2 beq- .loc_0x184 bge- .loc_0x38 cmpwi r0, 0x1 bge- .loc_0x44 b .loc_0x360 .loc_0x38: cmpwi r0, 0x4 bge- .loc_0x360 b .loc_0x1A8 .loc_0x44: lwz r3, 0x2DEC(r13) lfs f1, 0x70(r28) lfs f0, 0x28C(r3) fadds f0, f1, f0 stfs f0, 0x70(r28) lfs f1, 0x70(r28) lfs f0, -0x4144(r2) fcmpo cr0, f1, f0 ble- .loc_0x80 lfs f0, -0x4188(r2) li r0, 0x2 stfs f0, 0x70(r28) lfs f1, -0x4184(r2) stw r0, 0x74(r28) b .loc_0x90 .loc_0x80: fdivs f0, f1, f0 lfs f1, -0x4148(r2) fmuls f1, f1, f0 bl 0x35270 .loc_0x90: lfs f0, -0x4148(r2) fmuls f31, f0, f1 fmr f1, f31 bl 0x350CC lfs f0, -0x4178(r2) fmuls f0, f0, f1 fmr f1, f31 stfs f0, 0x7C(r28) lfs f0, -0x4188(r2) stfs f0, 0x80(r28) bl 0x35244 lfs f2, -0x4178(r2) fmuls f0, f2, f1 fsubs f0, f0, f2 stfs f0, 0x84(r28) lfs f1, 0x80(r28) lfs f0, -0x4188(r2) fcmpo cr0, f1, f0 cror 2, 0x1, 0x2 bne- .loc_0xEC lfs f0, -0x4154(r2) fadds f0, f0, f1 b .loc_0xF4 .loc_0xEC: lfs f0, -0x4154(r2) fsubs f0, f1, f0 .loc_0xF4: lfs f2, 0x7C(r28) fctiwz f1, f0 lfs f0, -0x4188(r2) fcmpo cr0, f2, f0 stfd f1, 0x100(r1) lwz r5, 0x104(r1) cror 2, 0x1, 0x2 bne- .loc_0x120 lfs f0, -0x4154(r2) fadds f0, f0, f2 b .loc_0x128 .loc_0x120: lfs f0, -0x4154(r2) fsubs f0, f2, f0 .loc_0x128: fctiwz f0, f0 lwz r3, 0x0(r28) lwzu r12, 0x4(r3) stfd f0, 0x100(r1) lwz r12, 0x14(r12) lwz r4, 0x104(r1) mtlr r12 blrl lwz r3, 0x0(r28) lwzu r12, 0x4(r3) lfs f1, 0x84(r28) lwz r12, 0x20(r12) mtlr r12 blrl lfs f0, -0x4148(r2) li r4, 0x1 lwz r3, 0x0(r28) fsubs f0, f31, f0 lfs f1, -0x4108(r2) addi r3, r3, 0x4 fsubs f1, f1, f0 bl -0x6035C b .loc_0x360 .loc_0x184: mr r3, r28 bl .loc_0x614 rlwinm. r0,r3,0,24,31 beq- .loc_0x360 li r0, 0x3 stw r0, 0x74(r28) lfs f0, -0x4188(r2) stfs f0, 0x70(r28) b .loc_0x360 .loc_0x1A8: lwz r3, 0x2DEC(r13) lfs f1, 0x70(r28) lfs f0, 0x28C(r3) fadds f0, f1, f0 stfs f0, 0x70(r28) lfs f1, 0x70(r28) lfs f0, -0x4144(r2) fcmpo cr0, f1, f0 ble- .loc_0x1F4 lfs f0, -0x4188(r2) li r4, 0 stfs f0, 0x70(r28) lfs f2, -0x4184(r2) stw r4, 0x74(r28) lwz r3, 0x0(r28) lbz r0, 0x10(r3) rlwimi r0,r4,7,24,24 stb r0, 0x10(r3) b .loc_0x20C .loc_0x1F4: fdivs f0, f1, f0 lfs f1, -0x4148(r2) fmuls f1, f1, f0 bl 0x34F68 lfs f0, -0x4184(r2) fsubs f2, f0, f1 .loc_0x20C: lwz r0, 0x78(r28) cmpwi r0, 0 bne- .loc_0x26C lfs f1, -0x40AC(r2) lfs f0, -0x4188(r2) fmuls f1, f1, f2 fcmpo cr0, f1, f0 cror 2, 0x1, 0x2 bne- .loc_0x23C lfs f0, -0x4154(r2) fadds f0, f0, f1 b .loc_0x244 .loc_0x23C: lfs f0, -0x4154(r2) fsubs f0, f1, f0 .loc_0x244: fctiwz f0, f0 lwz r3, 0x0(r28) lwzu r12, 0x4(r3) li r4, 0 stfd f0, 0x100(r1) lwz r12, 0x14(r12) lwz r5, 0x104(r1) mtlr r12 blrl b .loc_0x360 .loc_0x26C: lfs f1, -0x4148(r2) fmuls f0, f1, f2 fadds f31, f1, f0 fmr f1, f31 bl 0x34EEC lfs f0, -0x4178(r2) fmuls f0, f0, f1 fmr f1, f31 stfs f0, 0x7C(r28) lfs f0, -0x4188(r2) stfs f0, 0x80(r28) bl 0x35064 lfs f2, -0x4178(r2) fmuls f0, f2, f1 fsubs f0, f0, f2 stfs f0, 0x84(r28) lfs f1, 0x80(r28) lfs f0, -0x4188(r2) fcmpo cr0, f1, f0 cror 2, 0x1, 0x2 bne- .loc_0x2CC lfs f0, -0x4154(r2) fadds f0, f0, f1 b .loc_0x2D4 .loc_0x2CC: lfs f0, -0x4154(r2) fsubs f0, f1, f0 .loc_0x2D4: lfs f2, 0x7C(r28) fctiwz f1, f0 lfs f0, -0x4188(r2) fcmpo cr0, f2, f0 stfd f1, 0x100(r1) lwz r5, 0x104(r1) cror 2, 0x1, 0x2 bne- .loc_0x300 lfs f0, -0x4154(r2) fadds f0, f0, f2 b .loc_0x308 .loc_0x300: lfs f0, -0x4154(r2) fsubs f0, f2, f0 .loc_0x308: fctiwz f0, f0 lwz r3, 0x0(r28) lwzu r12, 0x4(r3) stfd f0, 0x100(r1) lwz r12, 0x14(r12) lwz r4, 0x104(r1) mtlr r12 blrl lwz r3, 0x0(r28) lwzu r12, 0x4(r3) lfs f1, 0x84(r28) lwz r12, 0x20(r12) mtlr r12 blrl lfs f0, -0x4148(r2) li r4, 0x1 lwz r3, 0x0(r28) fsubs f0, f31, f0 lfs f1, -0x4108(r2) addi r3, r3, 0x4 fsubs f1, f1, f0 bl -0x6053C .loc_0x360: lwz r3, 0x0(r28) lwz r12, 0x0(r3) lwz r12, 0x8(r12) mtlr r12 blrl addi r3, r28, 0x4 bl -0xC550 addi r3, r28, 0x34 bl -0xC558 lwz r3, 0x74(r28) neg r0, r3 cntlzw r0, r0 cmpwi r3, 0 rlwinm r30,r0,27,5,31 bne- .loc_0x4F4 lwz r3, 0x70(r31) lwz r0, 0x78(r3) cmpwi r0, 0 bne- .loc_0x4F4 lwz r3, 0x38(r31) li r26, 0 lwz r27, 0x34(r31) lwz r3, 0x4(r3) lbz r0, 0x35(r27) lwz r3, 0x28(r3) cmplwi r0, 0 lha r29, 0x18(r3) lha r28, 0x1A(r3) bne- .loc_0x4F4 lwz r0, 0x4(r27) cmpwi r0, 0x1 beq- .loc_0x40C bge- .loc_0x460 cmpwi r0, 0 bge- .loc_0x3F0 b .loc_0x460 .loc_0x3F0: lfs f0, -0x4188(r2) addi r3, r27, 0 li r26, 0x1 stfs f0, 0x0(r27) li r4, 0x1 bl -0x9008 b .loc_0x460 .loc_0x40C: lbz r0, 0x34(r27) cmplwi r0, 0 bne- .loc_0x460 xoris r0, r29, 0x8000 stw r0, 0x104(r1) xoris r0, r28, 0x8000 li r4, 0x1 lis r3, 0x4330 stb r4, 0x35(r27) stw r3, 0x100(r1) lfd f2, -0x4168(r2) stw r0, 0xFC(r1) lfd f0, 0x100(r1) stw r3, 0xF8(r1) fsubs f1, f0, f2 lfd f0, 0xF8(r1) fsubs f0, f0, f2 stfs f1, 0x38(r27) stfs f0, 0x3C(r27) lfs f0, 0x2560(r13) stfs f0, 0x40(r27) .loc_0x460: rlwinm. r0,r26,0,24,31 beq- .loc_0x4F4 lbz r0, 0x34(r27) cmplwi r0, 0 bne- .loc_0x488 lbz r0, 0x35(r27) cmplwi r0, 0 bne- .loc_0x488 li r3, 0x123 bl -0x141AFC .loc_0x488: li r0, 0x1 stw r0, 0x4(r27) lwz r0, 0x4(r27) cmpwi r0, 0x1 beq- .loc_0x4B4 bge- .loc_0x4B4 cmpwi r0, 0 bge- .loc_0x4AC b .loc_0x4B4 .loc_0x4AC: lfs f0, -0x4188(r2) stfs f0, 0x30(r27) .loc_0x4B4: xoris r0, r29, 0x8000 lfd f2, -0x4168(r2) stw r0, 0xFC(r1) xoris r0, r28, 0x8000 lis r3, 0x4330 stw r3, 0xF8(r1) stw r0, 0x104(r1) lfd f0, 0xF8(r1) stw r3, 0x100(r1) fsubs f1, f0, f2 lfd f0, 0x100(r1) fsubs f0, f0, f2 stfs f1, 0xC(r27) stfs f0, 0x10(r27) lfs f0, 0x2564(r13) stfs f0, 0x14(r27) .loc_0x4F4: lwz r28, 0x34(r31) lwz r0, 0x4(r28) cmpwi r0, 0x1 beq- .loc_0x524 bge- .loc_0x5B4 cmpwi r0, 0 bge- .loc_0x518 b .loc_0x5B4 b .loc_0x5B4 .loc_0x518: mr r3, r28 bl -0x6584 b .loc_0x5B4 .loc_0x524: mr r3, r28 bl -0x6A24 rlwinm. r0,r3,0,24,31 beq- .loc_0x5B4 lbz r0, 0x35(r28) cmplwi r0, 0 beq- .loc_0x54C mr r3, r28 bl -0x6B10 b .loc_0x5B4 .loc_0x54C: lbz r0, 0x34(r28) cmplwi r0, 0 beq- .loc_0x588 li r0, 0x2 stw r0, 0x4(r28) lwz r0, 0x4(r28) cmpwi r0, 0x1 beq- .loc_0x5B4 bge- .loc_0x5B4 cmpwi r0, 0 bge- .loc_0x57C b .loc_0x5B4 .loc_0x57C: lfs f0, -0x4188(r2) stfs f0, 0x30(r28) b .loc_0x5B4 .loc_0x588: li r0, 0 stw r0, 0x4(r28) lwz r0, 0x4(r28) cmpwi r0, 0x1 beq- .loc_0x5B4 bge- .loc_0x5B4 cmpwi r0, 0 bge- .loc_0x5AC b .loc_0x5B4 .loc_0x5AC: lfs f0, -0x4188(r2) stfs f0, 0x30(r28) .loc_0x5B4: mr r3, r28 bl -0x6ED4 li r26, 0 mulli r0, r26, 0x3C add r27, r28, r0 .loc_0x5C8: lwz r4, 0x8(r28) addi r3, r27, 0x44 addi r4, r4, 0xC0 bl -0x7518 addi r26, r26, 0x1 cmpwi r26, 0x3 addi r27, r27, 0x3C blt+ .loc_0x5C8 mr r3, r28 bl -0x7888 mr r3, r31 bl 0x33C mr r3, r30 lmw r26, 0x108(r1) lwz r0, 0x12C(r1) lfd f31, 0x120(r1) addi r1, r1, 0x128 mtlr r0 blr .loc_0x614: */ } /* * --INFO-- * Address: 801E7000 * Size: 0001C8 */ void zen::WorldMapConfirmMgr::modeOperation(Controller*) { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) stwu r1, -0x80(r1) stmw r25, 0x64(r1) mr r28, r4 mr r27, r3 li r30, 0 lwz r5, 0x28(r4) lwz r29, 0x78(r3) rlwinm r0,r5,0,12,12 neg r4, r0 subic r3, r4, 0x1 rlwinm r0,r5,0,10,10 subfe r4, r3, r4 neg r3, r0 subic r0, r3, 0x1 subfe r0, r0, r3 rlwinm r3,r4,0,24,31 rlwinm r0,r0,0,24,31 sub r0, r0, r3 add r0, r29, r0 stw r0, 0x78(r27) lwz r0, 0x78(r27) cmpwi r0, 0 bge- .loc_0x6C li r0, 0x1 stw r0, 0x78(r27) .loc_0x6C: lwz r0, 0x78(r27) cmpwi r0, 0x1 ble- .loc_0x80 li r0, 0 stw r0, 0x78(r27) .loc_0x80: lwz r0, 0x78(r27) li r25, 0 lwz r3, 0x64(r27) li r26, 0 mulli r0, r0, 0xC add r31, r3, r0 .loc_0x98: lwz r3, 0x78(r27) addi r5, r27, 0x68 lwz r0, 0x64(r27) addi r6, r27, 0x6C sub r3, r3, r25 cntlzw r3, r3 add r7, r0, r26 rlwinm r4,r3,27,5,31 lwz r3, 0x0(r7) bl -0x247A0 addi r25, r25, 0x1 cmpwi r25, 0x2 addi r26, r26, 0xC blt+ .loc_0x98 lwz r0, 0x78(r27) cmpw r29, r0 beq- .loc_0x170 li r3, 0x112 bl -0x141D6C lwz r4, 0x4(r31) lis r29, 0x4330 lfd f2, -0x4168(r2) addi r3, r27, 0x4 lha r0, 0x1A(r4) lha r4, 0x18(r4) xoris r0, r0, 0x8000 lfs f3, -0x4154(r2) xoris r4, r4, 0x8000 stw r0, 0x54(r1) stw r4, 0x5C(r1) stw r29, 0x58(r1) stw r29, 0x50(r1) lfd f1, 0x58(r1) lfd f0, 0x50(r1) fsubs f1, f1, f2 fsubs f2, f0, f2 bl -0xC580 lwz r4, 0x8(r31) addi r3, r27, 0x34 lfd f2, -0x4168(r2) lha r0, 0x1A(r4) lha r4, 0x18(r4) xoris r0, r0, 0x8000 lfs f3, -0x4154(r2) xoris r4, r4, 0x8000 stw r0, 0x44(r1) stw r4, 0x4C(r1) stw r29, 0x48(r1) stw r29, 0x40(r1) lfd f1, 0x48(r1) lfd f0, 0x40(r1) fsubs f1, f1, f2 fsubs f2, f0, f2 bl -0xC5C4 .loc_0x170: lis r3, 0x100 lwz r4, 0x28(r28) addi r0, r3, 0x1000 and. r0, r4, r0 beq- .loc_0x190 li r3, 0x111 bl -0x141E14 li r30, 0x1 .loc_0x190: lwz r0, 0x28(r28) rlwinm. r0,r0,0,18,18 beq- .loc_0x1B0 li r3, 0x11D bl -0x141E2C li r0, 0x1 stw r0, 0x78(r27) li r30, 0x1 .loc_0x1B0: mr r3, r30 lmw r25, 0x64(r1) lwz r0, 0x84(r1) addi r1, r1, 0x80 mtlr r0 blr */ } /* * --INFO-- * Address: 801E71C8 * Size: 000154 */ void zen::DrawWorldMap::modeEnd(Controller*) { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) stwu r1, -0x38(r1) stmw r27, 0x24(r1) mr r30, r3 li r31, 0 lwz r3, 0x58(r3) lbz r0, 0xAC(r3) cmplwi r0, 0 bne- .loc_0x38 lwz r3, 0x50(r30) li r4, 0x1 bl 0x2ADC li r31, 0x1 .loc_0x38: lwz r27, 0x34(r30) lwz r0, 0x4(r27) cmpwi r0, 0x1 beq- .loc_0x68 bge- .loc_0xF8 cmpwi r0, 0 bge- .loc_0x5C b .loc_0xF8 b .loc_0xF8 .loc_0x5C: mr r3, r27 bl -0x68A4 b .loc_0xF8 .loc_0x68: mr r3, r27 bl -0x6D44 rlwinm. r0,r3,0,24,31 beq- .loc_0xF8 lbz r0, 0x35(r27) cmplwi r0, 0 beq- .loc_0x90 mr r3, r27 bl -0x6E30 b .loc_0xF8 .loc_0x90: lbz r0, 0x34(r27) cmplwi r0, 0 beq- .loc_0xCC li r0, 0x2 stw r0, 0x4(r27) lwz r0, 0x4(r27) cmpwi r0, 0x1 beq- .loc_0xF8 bge- .loc_0xF8 cmpwi r0, 0 bge- .loc_0xC0 b .loc_0xF8 .loc_0xC0: lfs f0, -0x4188(r2) stfs f0, 0x30(r27) b .loc_0xF8 .loc_0xCC: li r0, 0 stw r0, 0x4(r27) lwz r0, 0x4(r27) cmpwi r0, 0x1 beq- .loc_0xF8 bge- .loc_0xF8 cmpwi r0, 0 bge- .loc_0xF0 b .loc_0xF8 .loc_0xF0: lfs f0, -0x4188(r2) stfs f0, 0x30(r27) .loc_0xF8: mr r3, r27 bl -0x71F4 li r29, 0 mulli r0, r29, 0x3C add r28, r27, r0 .loc_0x10C: lwz r4, 0x8(r27) addi r3, r28, 0x44 addi r4, r4, 0xC0 bl -0x7838 addi r29, r29, 0x1 cmpwi r29, 0x3 addi r28, r28, 0x3C blt+ .loc_0x10C mr r3, r27 bl -0x7BA8 mr r3, r30 bl .loc_0x154 mr r3, r31 lmw r27, 0x24(r1) lwz r0, 0x3C(r1) addi r1, r1, 0x38 mtlr r0 blr .loc_0x154: */ } /* * --INFO-- * Address: 801E731C * Size: 0000DC */ void zen::DrawWorldMap::updateScreens() { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) stwu r1, -0x18(r1) stw r31, 0x14(r1) mr r31, r3 lwz r3, 0x10(r3) lwz r12, 0x0(r3) lwz r12, 0x8(r12) mtlr r12 blrl lwz r3, 0x1C(r31) lwz r12, 0x0(r3) lwz r12, 0x8(r12) mtlr r12 blrl lwz r3, 0x14(r31) lwz r12, 0x0(r3) lwz r12, 0x8(r12) mtlr r12 blrl lwz r3, 0x18(r31) lwz r12, 0x0(r3) lwz r12, 0x8(r12) mtlr r12 blrl lwz r3, 0x20(r31) lwz r12, 0x0(r3) lwz r12, 0x8(r12) mtlr r12 blrl lwz r3, 0x24(r31) lwz r12, 0x0(r3) lwz r12, 0x8(r12) mtlr r12 blrl lwz r3, 0x28(r31) lwz r12, 0x0(r3) lwz r12, 0x8(r12) mtlr r12 blrl lwz r3, 0x2C(r31) lwz r12, 0x0(r3) lwz r12, 0x8(r12) mtlr r12 blrl lwz r3, 0x30(r31) lwz r12, 0x0(r3) lwz r12, 0x8(r12) mtlr r12 blrl lwz r0, 0x1C(r1) lwz r31, 0x14(r1) addi r1, r1, 0x18 mtlr r0 blr */ } /* * --INFO-- * Address: 801E73F8 * Size: 000124 */ void zen::DrawWorldMap::closeMapInfo() { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) stwu r1, -0x40(r1) lwz r4, 0x54(r3) lwz r0, 0x4(r4) cmpwi r0, 0x1 beq- .loc_0x54 bge- .loc_0x2C cmpwi r0, 0 bge- .loc_0x38 b .loc_0x54 .loc_0x2C: cmpwi r0, 0x3 bge- .loc_0x54 b .loc_0x4C .loc_0x38: lfs f0, -0x4188(r2) li r0, 0x1 stfs f0, 0x0(r4) stw r0, 0x4(r4) b .loc_0x54 .loc_0x4C: li r0, 0x1 stb r0, 0x20(r4) .loc_0x54: lwz r10, 0x5C(r3) lwz r0, 0x4(r10) cmpwi r0, -0x1 beq- .loc_0x108 mulli r0, r0, 0x28 lwz r4, 0x0(r10) lfd f2, -0x4168(r2) add r8, r4, r0 lwz r9, 0x4(r8) lis r7, 0x4330 li r4, 0x2 lha r5, 0x18(r9) li r6, 0x1 lha r9, 0x1A(r9) li r0, -0x1 xoris r5, r5, 0x8000 stw r5, 0x3C(r1) xoris r5, r9, 0x8000 stw r7, 0x38(r1) stw r5, 0x34(r1) lfd f0, 0x38(r1) stw r7, 0x30(r1) fsubs f1, f0, f2 lfd f0, 0x30(r1) fsubs f0, f0, f2 stfs f1, 0x10(r8) stfs f0, 0x14(r8) lfs f0, 0x2480(r13) stfs f0, 0x18(r8) lfs f2, 0x14(r8) lfs f1, -0x40A8(r2) lfs f0, 0x10(r8) fsubs f1, f2, f1 stfs f0, 0x1C(r8) stfs f1, 0x20(r8) lfs f0, 0x18(r8) stfs f0, 0x24(r8) lfs f0, -0x4188(r2) stfs f0, 0x8(r8) stw r4, 0x0(r8) lwz r5, 0x4(r8) lbz r4, 0xC(r5) rlwimi r4,r6,7,24,24 stb r4, 0xC(r5) stw r0, 0x4(r10) .loc_0x108: lwz r3, 0x60(r3) li r4, -0x1 bl .loc_0x124 lwz r0, 0x44(r1) addi r1, r1, 0x40 mtlr r0 blr .loc_0x124: */ } /* * --INFO-- * Address: 801E751C * Size: 00020C */ void zen::WorldMapPartsInfoMgr::setActiveMapNo(@unnamed @ ::WorldMapName) { /* .loc_0x0: mflr r0 cmpwi r4, -0x1 stw r0, 0x4(r1) stwu r1, -0x30(r1) stw r31, 0x2C(r1) stw r30, 0x28(r1) addi r30, r3, 0 bne- .loc_0x2C li r3, 0 li r31, 0 b .loc_0x130 .loc_0x2C: lwz r3, 0x2F6C(r13) cmplwi r3, 0 beq- .loc_0xC0 cmpwi r4, 0x2 beq- .loc_0x84 bge- .loc_0x54 cmpwi r4, 0 beq- .loc_0x64 bge- .loc_0x74 b .loc_0xB4 .loc_0x54: cmpwi r4, 0x4 beq- .loc_0xA4 bge- .loc_0xB4 b .loc_0x94 .loc_0x64: li r31, 0x2 li r4, 0 bl -0x167974 b .loc_0x130 .loc_0x74: li r31, 0x8 li r4, 0x1 bl -0x167984 b .loc_0x130 .loc_0x84: li r31, 0x9 li r4, 0x2 bl -0x167994 b .loc_0x130 .loc_0x94: li r31, 0xA li r4, 0x3 bl -0x1679A4 b .loc_0x130 .loc_0xA4: li r31, 0x1 li r4, 0x4 bl -0x1679B4 b .loc_0x130 .loc_0xB4: li r31, 0 li r3, 0 b .loc_0x130 .loc_0xC0: cmpwi r4, 0x2 beq- .loc_0x104 bge- .loc_0xDC cmpwi r4, 0 beq- .loc_0xEC bge- .loc_0xF8 b .loc_0x128 .loc_0xDC: cmpwi r4, 0x4 beq- .loc_0x11C bge- .loc_0x128 b .loc_0x110 .loc_0xEC: li r31, 0x2 li r3, 0x1 b .loc_0x130 .loc_0xF8: li r31, 0x8 li r3, 0x2 b .loc_0x130 .loc_0x104: li r31, 0x9 li r3, 0x3 b .loc_0x130 .loc_0x110: li r31, 0xA li r3, 0x4 b .loc_0x130 .loc_0x11C: li r31, 0x1 li r3, 0 b .loc_0x130 .loc_0x128: li r31, 0 li r3, 0 .loc_0x130: li r4, 0 addi r5, r4, 0 b .loc_0x1E8 .loc_0x13C: cmpw r4, r31 bge- .loc_0x1B4 cmpw r4, r3 bge- .loc_0x180 lwz r6, 0x8(r30) li r8, 0x1 li r7, 0 lwzx r6, r6, r5 lbz r0, 0xC(r6) rlwimi r0,r8,7,24,24 stb r0, 0xC(r6) lwz r6, 0x4(r30) lwzx r6, r6, r5 lbz r0, 0xC(r6) rlwimi r0,r7,7,24,24 stb r0, 0xC(r6) b .loc_0x1E0 .loc_0x180: lwz r6, 0x8(r30) li r8, 0 li r7, 0x1 lwzx r6, r6, r5 lbz r0, 0xC(r6) rlwimi r0,r8,7,24,24 stb r0, 0xC(r6) lwz r6, 0x4(r30) lwzx r6, r6, r5 lbz r0, 0xC(r6) rlwimi r0,r7,7,24,24 stb r0, 0xC(r6) b .loc_0x1E0 .loc_0x1B4: lwz r6, 0x8(r30) li r7, 0 lwzx r6, r6, r5 lbz r0, 0xC(r6) rlwimi r0,r7,7,24,24 stb r0, 0xC(r6) lwz r6, 0x4(r30) lwzx r6, r6, r5 lbz r0, 0xC(r6) rlwimi r0,r7,7,24,24 stb r0, 0xC(r6) .loc_0x1E0: addi r5, r5, 0x4 addi r4, r4, 0x1 .loc_0x1E8: lwz r0, 0x0(r30) cmpw r4, r0 blt+ .loc_0x13C lwz r0, 0x34(r1) lwz r31, 0x2C(r1) lwz r30, 0x28(r1) addi r1, r1, 0x30 mtlr r0 blr */ } /* * --INFO-- * Address: 801E7728 * Size: 000220 */ void zen::DrawWorldMap::openMapInfo() { /* .loc_0x0: mflr r0 li r6, -0x1 stw r0, 0x4(r1) stwu r1, -0x28(r1) stw r31, 0x24(r1) stw r30, 0x20(r1) lwz r4, 0x38(r3) lwz r4, 0x4(r4) cmplwi r4, 0 beq- .loc_0x2C lwz r6, 0x10(r4) .loc_0x2C: lwz r4, 0x54(r3) lwz r0, 0x4(r4) cmpwi r0, 0x1 bne- .loc_0x50 lfs f0, -0x4188(r2) li r0, 0x2 stfs f0, 0x0(r4) stw r6, 0x8(r4) stw r0, 0x4(r4) .loc_0x50: lwz r7, 0x5C(r3) addi r4, r13, 0x2470 lbzx r4, r4, r6 lwz r0, 0x4(r7) cmpw r0, r4 beq- .loc_0xCC stw r4, 0x4(r7) li r5, 0x1 lwz r0, 0x4(r7) lwz r4, 0x0(r7) mulli r0, r0, 0x28 lfs f0, 0x2484(r13) add r4, r4, r0 stfs f0, 0x10(r4) lfs f0, 0x2488(r13) stfs f0, 0x14(r4) lfs f0, 0x248C(r13) stfs f0, 0x18(r4) lfs f0, 0x2490(r13) stfs f0, 0x1C(r4) lfs f0, 0x2494(r13) stfs f0, 0x20(r4) lfs f0, 0x2498(r13) stfs f0, 0x24(r4) lfs f0, -0x4188(r2) stfs f0, 0x8(r4) stw r5, 0x0(r4) lwz r4, 0x4(r4) lbz r0, 0xC(r4) rlwimi r0,r5,7,24,24 stb r0, 0xC(r4) .loc_0xCC: cmpwi r6, -0x1 lwz r30, 0x60(r3) bne- .loc_0xE4 li r5, 0 li r31, 0 b .loc_0x1FC .loc_0xE4: lwz r3, 0x2F6C(r13) cmplwi r3, 0 beq- .loc_0x18C cmpwi r6, 0x2 beq- .loc_0x144 bge- .loc_0x10C cmpwi r6, 0 beq- .loc_0x11C bge- .loc_0x130 b .loc_0x180 .loc_0x10C: cmpwi r6, 0x4 beq- .loc_0x16C bge- .loc_0x180 b .loc_0x158 .loc_0x11C: li r31, 0x2 li r4, 0 bl -0x167C38 mr r5, r3 b .loc_0x1FC .loc_0x130: li r31, 0x8 li r4, 0x1 bl -0x167C4C mr r5, r3 b .loc_0x1FC .loc_0x144: li r31, 0x9 li r4, 0x2 bl -0x167C60 mr r5, r3 b .loc_0x1FC .loc_0x158: li r31, 0xA li r4, 0x3 bl -0x167C74 mr r5, r3 b .loc_0x1FC .loc_0x16C: li r31, 0x1 li r4, 0x4 bl -0x167C88 mr r5, r3 b .loc_0x1FC .loc_0x180: li r31, 0 addi r5, r31, 0 b .loc_0x1FC .loc_0x18C: cmpwi r6, 0x2 beq- .loc_0x1D0 bge- .loc_0x1A8 cmpwi r6, 0 beq- .loc_0x1B8 bge- .loc_0x1C4 b .loc_0x1F4 .loc_0x1A8: cmpwi r6, 0x4 beq- .loc_0x1E8 bge- .loc_0x1F4 b .loc_0x1DC .loc_0x1B8: li r31, 0x2 li r5, 0x1 b .loc_0x1FC .loc_0x1C4: li r31, 0x8 li r5, 0x2 b .loc_0x1FC .loc_0x1D0: li r31, 0x9 li r5, 0x3 b .loc_0x1FC .loc_0x1DC: li r31, 0xA li r5, 0x4 b .loc_0x1FC .loc_0x1E8: li r31, 0x1 li r5, 0 b .loc_0x1FC .loc_0x1F4: li r31, 0 addi r5, r31, 0 .loc_0x1FC: addi r3, r30, 0 addi r4, r31, 0 bl -0x4F48 lwz r0, 0x2C(r1) lwz r31, 0x24(r1) lwz r30, 0x20(r1) addi r1, r1, 0x28 mtlr r0 blr */ } /* * --INFO-- * Address: 801E7948 * Size: 000168 */ void @unnamed @ ::DrawWorldMapDateCallBack::invoke(P2DPane*) { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) stwu r1, -0x30(r1) stw r31, 0x2C(r1) mr r31, r3 lwz r3, 0x2F6C(r13) bl -0x166DB0 addi r0, r3, 0x1 cmpwi r0, 0x9 ble- .loc_0xF0 lwz r5, 0x4(r31) lis r3, 0x6666 addi r3, r3, 0x6667 lbz r4, 0xC(r5) li r6, 0 rlwimi r4,r6,7,24,24 stb r4, 0xC(r5) mulhw r3, r3, r0 lwz r5, 0x8(r31) lbz r4, 0xC(r5) li r6, 0x1 rlwimi r4,r6,7,24,24 stb r4, 0xC(r5) srawi r3, r3, 0x2 rlwinm r4,r3,1,31,31 lwz r6, 0x8(r31) add r5, r3, r4 lis r4, 0x803D lbz r3, 0xF1(r6) rlwinm r5,r5,2,0,29 addi r4, r4, 0x2360 add r4, r4, r5 cmplwi r3, 0 lwz r3, 0x0(r4) ble- .loc_0x90 stw r3, 0xEC(r6) .loc_0x90: lis r3, 0x6666 lwz r6, 0xC(r31) addi r3, r3, 0x6667 mulhw r3, r3, r0 lbz r5, 0xC(r6) srawi r3, r3, 0x2 li r4, 0x1 rlwimi r5,r4,7,24,24 rlwinm r4,r3,1,31,31 stb r5, 0xC(r6) add r3, r3, r4 mulli r4, r3, 0xA lwz r6, 0xC(r31) lbz r3, 0xF1(r6) sub r0, r0, r4 lis r4, 0x803D rlwinm r5,r0,2,0,29 addi r0, r4, 0x2360 add r4, r0, r5 cmplwi r3, 0 lwz r0, 0x0(r4) ble- .loc_0x150 stw r0, 0xEC(r6) b .loc_0x150 .loc_0xF0: lwz r6, 0x4(r31) lis r3, 0x803D li r4, 0x1 lbz r5, 0xC(r6) rlwimi r5,r4,7,24,24 rlwinm r4,r0,2,0,29 stb r5, 0xC(r6) addi r0, r3, 0x2360 add r3, r0, r4 lwz r4, 0x4(r31) lwz r3, 0x0(r3) lbz r0, 0xF1(r4) cmplwi r0, 0 ble- .loc_0x12C stw r3, 0xEC(r4) .loc_0x12C: lwz r3, 0x8(r31) li r4, 0 lbz r0, 0xC(r3) rlwimi r0,r4,7,24,24 stb r0, 0xC(r3) lwz r3, 0xC(r31) lbz r0, 0xC(r3) rlwimi r0,r4,7,24,24 stb r0, 0xC(r3) .loc_0x150: lwz r0, 0x34(r1) li r3, 0x1 lwz r31, 0x2C(r1) addi r1, r1, 0x30 mtlr r0 blr */ } ======================= File: src/plugPikiYamashita/drawHiScore.cpp ======================= #include "types.h" /* * --INFO-- * Address: ........ * Size: 00009C */ void _Error(char*,...) { // UNUSED FUNCTION } /* * --INFO-- * Address: ........ * Size: 0000F4 */ void _Print(char*,...) { // UNUSED FUNCTION } /* * --INFO-- * Address: 801F0A80 * Size: 0003D8 */ zen::DrawHiScore::DrawHiScore() { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) stwu r1, -0x70(r1) stmw r22, 0x48(r1) li r22, 0 addi r29, r3, 0 stw r22, 0x10(r3) lis r3, 0x8022 addi r5, r3, 0x2758 stw r22, 0x14(r29) addi r3, r29, 0x2C stw r22, 0x18(r29) lwz r4, 0x0(r5) lwz r0, 0x4(r5) stw r4, 0x20(r29) stw r0, 0x24(r29) lwz r0, 0x8(r5) stw r0, 0x28(r29) stw r22, 0x1C(r29) bl 0xF0C stw r22, 0x0(r29) li r3, 0x100 bl -0x1A9AD4 addi r22, r3, 0 mr. r3, r22 beq- .loc_0x80 lis r4, 0x802E addi r4, r4, 0x7130 li r5, 0 li r6, 0x1 li r7, 0x1 bl -0x31588 .loc_0x80: stw r22, 0x4(r29) lis r3, 0x7474 addi r4, r3, 0x616C lwz r3, 0x4(r29) li r5, 0x1 addi r30, r3, 0x4 addi r3, r30, 0 lwz r12, 0x0(r30) lwz r12, 0x34(r12) mtlr r12 blrl stw r3, 0x8(r29) addi r3, r30, 0 lis r4, 0x6368 lwz r12, 0x0(r30) addi r4, r4, 0x6172 li r5, 0x1 lwz r12, 0x34(r12) mtlr r12 blrl stw r3, 0xC(r29) addi r4, r30, 0 addi r3, r29, 0x10 bl -0x2648 lwz r4, 0x14(r29) lis r3, 0x803A subi r23, r3, 0x2848 lbz r0, 0xC(r4) li r5, 0 li r31, 0 rlwimi r0,r5,7,24,24 stb r0, 0xC(r4) rlwinm r0,r31,3,0,28 rlwinm r3,r31,2,0,29 addi r28, r1, 0x20 add r25, r23, r0 add r26, r23, r3 addi r27, r23, 0x94 add r28, r28, r3 li r24, 0 .loc_0x120: addi r5, r31, 0 crclr 6, 0x6 addi r3, r1, 0x40 addi r4, r13, 0x2968 bl 0x259E8 lbz r0, 0x41(r1) mr r3, r29 lbz r5, 0x40(r1) mr r4, r30 rlwinm r0,r0,16,0,15 lbz r7, 0x42(r1) rlwimi r0,r5,24,0,7 lbz r8, 0x43(r1) rlwimi r0,r7,8,16,23 lwz r6, 0xBC(r25) or r5, r8, r0 li r7, 0x2 li r8, 0x1 bl 0x5D0 addi r5, r31, 0 crclr 6, 0x6 addi r3, r1, 0x40 addi r4, r13, 0x2970 bl 0x2599C lbz r0, 0x41(r1) mr r3, r29 lbz r5, 0x40(r1) mr r4, r30 rlwinm r0,r0,16,0,15 lbz r7, 0x42(r1) rlwimi r0,r5,24,0,7 lbz r8, 0x43(r1) rlwimi r0,r7,8,16,23 lwz r6, 0xC0(r25) or r5, r8, r0 li r7, 0x2 li r8, 0x1 bl 0x584 addi r5, r31, 0 crclr 6, 0x6 addi r3, r1, 0x40 addi r4, r13, 0x2978 bl 0x25950 lbz r0, 0x41(r1) mr r3, r29 lbz r5, 0x40(r1) mr r4, r30 rlwinm r0,r0,16,0,15 lbz r7, 0x42(r1) rlwimi r0,r5,24,0,7 lbz r8, 0x43(r1) rlwimi r0,r7,8,16,23 lwz r6, 0xE4(r26) or r5, r8, r0 li r7, 0x4 li r8, 0x1 bl 0x538 addi r5, r31, 0 crclr 6, 0x6 addi r3, r1, 0x40 addi r4, r13, 0x2980 bl 0x25904 lwz r0, 0xF8(r26) cmpwi r0, 0x270F mr r6, r0 bne- .loc_0x22C li r6, -0x1 .loc_0x22C: lbz r0, 0x41(r1) mr r3, r29 lbz r5, 0x40(r1) mr r4, r30 rlwinm r0,r0,16,0,15 lbz r7, 0x42(r1) rlwimi r0,r5,24,0,7 lbz r8, 0x43(r1) rlwimi r0,r7,8,16,23 or r5, r8, r0 li r7, 0x4 li r8, 0x1 bl 0x4DC cmpwi r31, 0 blt- .loc_0x290 cmpwi r31, 0x5 bgt- .loc_0x290 li r0, 0x1 lbz r3, 0xB6(r23) slw r0, r0, r31 and r0, r3, r0 neg r3, r0 subic r0, r3, 0x1 subfe r0, r0, r3 b .loc_0x294 .loc_0x290: li r0, 0 .loc_0x294: rlwinm. r0,r0,0,24,31 bne- .loc_0x2FC addi r5, r31, 0 crclr 6, 0x6 addi r3, r1, 0x40 addi r4, r13, 0x2988 bl 0x2586C lwz r12, 0x0(r30) mr r3, r30 lbz r0, 0x41(r1) li r5, 0x1 lwz r12, 0x34(r12) lbz r4, 0x40(r1) rlwinm r0,r0,16,0,15 lbz r6, 0x42(r1) mtlr r12 rlwimi r0,r4,24,0,7 lbz r7, 0x43(r1) rlwimi r0,r6,8,16,23 or r4, r7, r0 blrl lbz r0, 0xC(r3) li r4, 0 rlwimi r0,r4,7,24,24 stb r0, 0xC(r3) b .loc_0x300 .loc_0x2FC: addi r24, r24, 0x1 .loc_0x300: li r22, 0 .loc_0x304: stw r22, 0x20(r1) addi r3, r27, 0 addi r4, r1, 0x20 bl -0x19CECC addi r5, r22, 0 crclr 6, 0x6 addi r6, r31, 0 addi r3, r1, 0x40 addi r4, r13, 0x2990 bl 0x257F0 lbz r0, 0x41(r1) mr r3, r29 lbz r5, 0x40(r1) mr r4, r30 rlwinm r0,r0,16,0,15 lbz r7, 0x42(r1) rlwimi r0,r5,24,0,7 lbz r8, 0x43(r1) rlwimi r0,r7,8,16,23 lwz r6, 0xC(r28) or r5, r8, r0 li r7, 0x3 li r8, 0x1 bl 0x3D8 addi r22, r22, 0x1 cmpwi r22, 0x5 blt+ .loc_0x304 addi r31, r31, 0x1 cmpwi r31, 0x5 addi r25, r25, 0x8 addi r26, r26, 0x4 addi r28, r28, 0x4 blt+ .loc_0x120 cmpwi r24, 0 bne- .loc_0x3C0 lwz r3, 0x8(r29) li r4, 0x1B li r5, 0x82 lwz r12, 0x0(r3) lwz r12, 0x14(r12) mtlr r12 blrl lwz r3, 0xC(r29) li r4, 0 lbz r0, 0xC(r3) rlwimi r0,r4,7,24,24 stb r0, 0xC(r3) .loc_0x3C0: mr r3, r29 lmw r22, 0x48(r1) lwz r0, 0x74(r1) addi r1, r1, 0x70 mtlr r0 blr */ } /* * --INFO-- * Address: 801F0E58 * Size: 00012C */ void zen::DrawHiScore::update(Controller*) { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) stwu r1, -0x28(r1) stw r31, 0x24(r1) li r31, 0 stw r30, 0x20(r1) addi r30, r4, 0 stw r29, 0x1C(r1) mr r29, r3 lwz r3, 0x4(r3) lwz r12, 0x0(r3) lwz r12, 0x8(r12) mtlr r12 blrl addi r3, r29, 0x10 bl -0x26F8 addi r3, r29, 0x2C bl 0xB84 lwz r0, 0x0(r29) cmpwi r0, 0x2 beq- .loc_0x88 bge- .loc_0x64 cmpwi r0, 0x1 bge- .loc_0x70 b .loc_0x10C .loc_0x64: cmpwi r0, 0x4 bge- .loc_0x10C b .loc_0xF4 .loc_0x70: lwz r0, 0x2C(r29) cmpwi r0, 0 bne- .loc_0x10C li r0, 0x2 stw r0, 0x0(r29) b .loc_0x10C .loc_0x88: lwz r0, 0x28(r30) rlwinm. r0,r0,0,18,18 beq- .loc_0x10C li r3, 0x11D bl -0x14BB7C li r0, 0x3 stw r0, 0x0(r29) li r5, 0 li r0, 0xFF stb r5, 0x14(r1) addi r3, r29, 0x2C li r4, 0 stb r5, 0x10(r1) stb r5, 0x15(r1) stb r5, 0x11(r1) stb r5, 0x16(r1) stb r5, 0x12(r1) stb r0, 0x17(r1) stb r0, 0x13(r1) lwz r0, 0x14(r1) stw r0, 0x4C(r29) lwz r0, 0x10(r1) stw r0, 0x50(r29) lfs f1, -0x3DF0(r2) lfs f2, -0x3DEC(r2) bl 0xDCC b .loc_0x10C .loc_0xF4: lwz r0, 0x2C(r29) cmpwi r0, 0 bne- .loc_0x10C li r0, 0 stw r0, 0x0(r29) li r31, 0x1 .loc_0x10C: mr r3, r31 lwz r0, 0x2C(r1) lwz r31, 0x24(r1) lwz r30, 0x20(r1) lwz r29, 0x1C(r1) addi r1, r1, 0x28 mtlr r0 blr */ } /* * --INFO-- * Address: 801F0F84 * Size: 0001B0 */ void zen::DrawHiScore::draw(Graphics&) { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) stwu r1, -0x88(r1) stw r31, 0x84(r1) addi r31, r4, 0 stw r30, 0x80(r1) mr r30, r3 stw r29, 0x7C(r1) stw r28, 0x78(r1) lwz r0, 0x0(r3) li r3, 0 cmpwi r0, 0x2 beq- .loc_0x78 bge- .loc_0x44 cmpwi r0, 0x1 bge- .loc_0x50 b .loc_0xA4 .loc_0x44: cmpwi r0, 0x4 bge- .loc_0xA4 b .loc_0x80 .loc_0x50: lwz r0, 0x30(r30) rlwinm. r0,r0,0,30,30 beq- .loc_0x64 li r0, 0x1 b .loc_0x68 .loc_0x64: li r0, 0 .loc_0x68: cmpwi r0, 0 beq- .loc_0xA4 li r3, 0x1 b .loc_0xA4 .loc_0x78: li r3, 0x1 b .loc_0xA4 .loc_0x80: lwz r0, 0x30(r30) rlwinm. r0,r0,0,31,31 beq- .loc_0x94 li r0, 0x1 b .loc_0x98 .loc_0x94: li r0, 0 .loc_0x98: cmpwi r0, 0 beq- .loc_0xA4 li r3, 0x1 .loc_0xA4: rlwinm. r0,r3,0,24,31 beq- .loc_0x184 lwz r6, 0x310(r31) li r28, 0 lwz r0, 0x30C(r31) addi r5, r1, 0x28 addi r3, r31, 0 stw r28, 0x28(r1) addi r4, r1, 0x38 stw r28, 0x2C(r1) stw r0, 0x30(r1) stw r6, 0x34(r1) lwz r12, 0x3B4(r31) lwz r12, 0x40(r12) mtlr r12 blrl stb r28, 0x24(r1) li r29, 0xFF addi r4, r1, 0x24 stb r28, 0x25(r1) mr r3, r31 li r5, 0x1 stb r28, 0x26(r1) stb r29, 0x27(r1) lwz r12, 0x3B4(r31) lwz r12, 0xA8(r12) mtlr r12 blrl stb r28, 0x20(r1) li r0, 0x40 addi r4, r1, 0x20 stb r28, 0x21(r1) mr r3, r31 stb r0, 0x22(r1) stb r29, 0x23(r1) lwz r12, 0x3B4(r31) lwz r12, 0xAC(r12) mtlr r12 blrl lwz r5, 0x310(r31) addi r4, r1, 0x10 lwz r0, 0x30C(r31) mr r3, r31 stw r28, 0x10(r1) stw r28, 0x14(r1) stw r0, 0x18(r1) stw r5, 0x1C(r1) lwz r12, 0x3B4(r31) lwz r12, 0xD4(r12) mtlr r12 blrl lwz r3, 0x4(r30) lwz r12, 0x0(r3) lwz r12, 0xC(r12) mtlr r12 blrl .loc_0x184: addi r3, r30, 0x2C addi r4, r31, 0 bl 0xB1C lwz r0, 0x8C(r1) lwz r31, 0x84(r1) lwz r30, 0x80(r1) lwz r29, 0x7C(r1) lwz r28, 0x78(r1) addi r1, r1, 0x88 mtlr r0 blr */ } /* * --INFO-- * Address: 801F1134 * Size: 000084 */ void zen::DrawHiScore::start() { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) li r0, 0x1 stwu r1, -0x20(r1) stw r31, 0x1C(r1) addi r31, r3, 0 stw r0, 0x0(r3) addi r3, r31, 0x10 bl -0x2918 li r5, 0 stb r5, 0x10(r1) li r0, 0xFF addi r3, r31, 0x2C stb r5, 0xC(r1) li r4, 0x1 stb r5, 0x11(r1) stb r5, 0xD(r1) stb r5, 0x12(r1) stb r5, 0xE(r1) stb r0, 0x13(r1) stb r0, 0xF(r1) lwz r0, 0x10(r1) stw r0, 0x4C(r31) lwz r0, 0xC(r1) stw r0, 0x50(r31) lfs f1, -0x3DF0(r2) lfs f2, -0x3DEC(r2) bl 0xB70 lwz r0, 0x24(r1) lwz r31, 0x1C(r1) addi r1, r1, 0x20 mtlr r0 blr */ } /* * --INFO-- * Address: 801F11B8 * Size: 00033C */ void zen::DrawHiScore::rewriteNumber(P2DScreen*, unsigned long, int, int, bool) { /* .loc_0x0: mflr r0 mr r3, r4 stw r0, 0x4(r1) stwu r1, -0x68(r1) stmw r18, 0x30(r1) mr r29, r6 mr r30, r7 addi r18, r8, 0 stw r5, 0x10(r1) li r5, 0x1 lwz r12, 0x0(r4) lwz r4, 0x10(r1) lwz r12, 0x34(r12) mtlr r12 blrl mr r31, r3 lhz r0, 0x8(r3) cmplwi r0, 0x13 bne- .loc_0x328 addi r3, r30, 0x1 bl -0x1AA204 rlwinm. r0,r18,0,24,31 beq- .loc_0xF0 cmpwi r29, 0 bge- .loc_0xF0 cmpwi r30, 0 li r5, 0 ble- .loc_0xE4 cmpwi r30, 0x8 subi r4, r30, 0x8 ble- .loc_0xC0 addi r0, r4, 0x7 rlwinm r0,r0,29,3,31 cmpwi r4, 0 mtctr r0 li r0, 0x2A ble- .loc_0xC0 .loc_0x94: add r4, r3, r5 stb r0, 0x0(r4) addi r5, r5, 0x8 stb r0, 0x1(r4) stb r0, 0x2(r4) stb r0, 0x3(r4) stb r0, 0x4(r4) stb r0, 0x5(r4) stb r0, 0x6(r4) stb r0, 0x7(r4) bdnz+ .loc_0x94 .loc_0xC0: sub r0, r30, r5 cmpw r5, r30 mtctr r0 add r4, r3, r5 li r0, 0x2A bge- .loc_0xE4 .loc_0xD8: stb r0, 0x0(r4) addi r4, r4, 0x1 bdnz+ .loc_0xD8 .loc_0xE4: li r0, 0 stbx r0, r3, r30 b .loc_0x324 .loc_0xF0: cmpwi r30, 0 li r25, 0x1 li r26, 0 ble- .loc_0x31C cmpwi r30, 0x8 subi r5, r30, 0x8 ble- .loc_0x2CC addi r0, r5, 0x7 rlwinm r0,r0,29,3,31 lis r4, 0x6666 mtctr r0 cmpwi r5, 0 addi r27, r4, 0x6667 ble- .loc_0x2CC .loc_0x128: divw r18, r29, r25 mulli r25, r25, 0xA divw r7, r29, r25 mulli r25, r25, 0xA divw r6, r29, r25 mulli r25, r25, 0xA divw r5, r29, r25 mulli r25, r25, 0xA divw r4, r29, r25 mulli r25, r25, 0xA divw r0, r29, r25 mulli r25, r25, 0xA divw r22, r29, r25 mulhw r8, r27, r18 srawi r9, r8, 0x2 mulhw r8, r27, r7 rlwinm r10,r9,1,31,31 add r10, r9, r10 srawi r9, r8, 0x2 mulhw r8, r27, r6 mulli r12, r10, 0xA rlwinm r10,r9,1,31,31 add r10, r9, r10 srawi r9, r8, 0x2 mulhw r8, r27, r5 mulli r11, r10, 0xA rlwinm r10,r9,1,31,31 sub r28, r18, r12 sub r12, r30, r26 add r10, r9, r10 srawi r9, r8, 0x2 mulhw r8, r27, r4 addi r19, r26, 0x1 mulli r21, r10, 0xA rlwinm r18,r9,1,31,31 sub r11, r7, r11 sub r10, r30, r19 add r9, r9, r18 srawi r20, r8, 0x2 mulhw r7, r27, r0 addi r8, r26, 0x2 mulli r18, r9, 0xA rlwinm r19,r20,1,31,31 sub r9, r6, r21 sub r8, r30, r8 add r6, r20, r19 srawi r21, r7, 0x2 mulhw r23, r27, r22 addi r24, r26, 0x3 mulli r19, r6, 0xA rlwinm r20,r21,1,31,31 sub r7, r5, r18 sub r6, r30, r24 add r5, r21, r20 srawi r24, r23, 0x2 addi r21, r26, 0x4 mulli r20, r5, 0xA rlwinm r23,r24,1,31,31 sub r5, r4, r19 sub r4, r30, r21 add r23, r24, r23 addi r21, r26, 0x5 mulli r23, r23, 0xA sub r20, r0, r20 sub r21, r30, r21 addi r0, r26, 0x6 sub r23, r22, r23 sub r24, r30, r0 addi r18, r28, 0x30 subi r0, r12, 0x1 stbx r18, r3, r0 addi r11, r11, 0x30 subi r0, r10, 0x1 stbx r11, r3, r0 addi r9, r9, 0x30 subi r0, r8, 0x1 stbx r9, r3, r0 addi r7, r7, 0x30 subi r0, r6, 0x1 stbx r7, r3, r0 addi r5, r5, 0x30 subi r0, r4, 0x1 stbx r5, r3, r0 addi r4, r20, 0x30 subi r0, r21, 0x1 stbx r4, r3, r0 addi r4, r23, 0x30 subi r0, r24, 0x1 stbx r4, r3, r0 mulli r25, r25, 0xA divw r5, r29, r25 mulhw r0, r27, r5 srawi r0, r0, 0x2 rlwinm r4,r0,1,31,31 add r0, r0, r4 mulli r4, r0, 0xA addi r0, r26, 0x7 sub r5, r5, r4 sub r4, r30, r0 addi r5, r5, 0x30 subi r0, r4, 0x1 mulli r25, r25, 0xA stbx r5, r3, r0 addi r26, r26, 0x8 bdnz+ .loc_0x128 .loc_0x2CC: sub r0, r30, r26 lis r4, 0x6666 mtctr r0 cmpw r26, r30 addi r6, r4, 0x6667 bge- .loc_0x31C .loc_0x2E4: divw r5, r29, r25 mulhw r0, r6, r5 srawi r0, r0, 0x2 rlwinm r4,r0,1,31,31 add r0, r0, r4 mulli r0, r0, 0xA sub r4, r30, r26 sub r5, r5, r0 addi r5, r5, 0x30 subi r0, r4, 0x1 mulli r25, r25, 0xA stbx r5, r3, r0 addi r26, r26, 0x1 bdnz+ .loc_0x2E4 .loc_0x31C: li r0, 0 stbx r0, r3, r30 .loc_0x324: stw r3, 0x10C(r31) .loc_0x328: lmw r18, 0x30(r1) lwz r0, 0x6C(r1) addi r1, r1, 0x68 mtlr r0 blr */ } ======================= File: src/plugPikiOgawa/ogDiary.cpp ======================= #include "types.h" /* * --INFO-- * Address: ........ * Size: 00009C */ void _Error(char*,...) { // UNUSED FUNCTION } /* * --INFO-- * Address: ........ * Size: 0000F4 */ void _Print(char*,...) { // UNUSED FUNCTION } /* * --INFO-- * Address: 8018F1F4 * Size: 000150 */ zen::ogScrDiaryMgr::ogScrDiaryMgr() { /* .loc_0x0: mflr r0 lis r4, 0x802D stw r0, 0x4(r1) addi r4, r4, 0x5DE8 li r5, 0x1 stwu r1, -0x30(r1) stw r31, 0x2C(r1) addi r31, r3, 0 stw r30, 0x28(r1) stw r29, 0x24(r1) lwz r3, 0x2DEC(r13) bl -0x150118 addi r30, r3, 0 li r3, 0x10 bl -0x148228 stw r3, 0x14(r31) addi r4, r30, 0 li r5, 0x15 lwz r3, 0x14(r31) li r6, 0x2A bl -0x16758C li r3, 0x6C bl -0x148248 addi r30, r3, 0 mr. r3, r30 beq- .loc_0x70 li r4, 0 bl 0x310B0 .loc_0x70: stw r30, 0x10(r31) lis r3, 0x1 subi r3, r3, 0x5A10 lfs f0, -0x4ED8(r2) stfs f0, 0x31B0(r13) bl -0x148274 addi r30, r3, 0 mr. r3, r30 beq- .loc_0xA0 lis r4, 0x802D addi r4, r4, 0x5DF4 bl -0x2CEC .loc_0xA0: stw r30, 0x4(r31) addi r4, r13, 0xD88 lwz r3, 0x4(r31) bl -0x2D44 lwz r4, 0x4(r31) li r0, 0x1 lis r3, 0x6361 stb r0, 0x4DE(r4) li r30, 0 addi r4, r3, 0x7075 lwz r3, 0x4(r31) li r5, 0x1 stb r30, 0x4E0(r3) lwz r3, 0x4(r31) lwz r29, 0x0(r3) mr r3, r29 lwz r12, 0x0(r29) lwz r12, 0x34(r12) mtlr r12 blrl stw r3, 0x18(r31) addi r3, r29, 0 lis r4, 0x6261 lwz r12, 0x0(r29) addi r4, r4, 0x7365 li r5, 0x1 lwz r12, 0x34(r12) mtlr r12 blrl lbz r4, 0xC(r3) rlwimi r4,r30,7,24,24 li r0, -0x1 stb r4, 0xC(r3) mr r3, r31 stw r30, 0x8(r31) stw r30, 0xC(r31) stw r0, 0x0(r31) lwz r0, 0x34(r1) lwz r31, 0x2C(r1) lwz r30, 0x28(r1) lwz r29, 0x24(r1) addi r1, r1, 0x30 mtlr r0 blr */ } /* * --INFO-- * Address: 8018F344 * Size: 0000FC */ void zen::ogScrDiaryMgr::update(Controller*) { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) stwu r1, -0x30(r1) stw r31, 0x2C(r1) mr r31, r3 stw r30, 0x28(r1) stw r29, 0x24(r1) addi r29, r4, 0 lwz r3, 0x0(r3) cmpwi r3, -0x1 bne- .loc_0x30 b .loc_0xE0 .loc_0x30: lwz r3, 0x4(r31) mr r4, r29 bl -0x29B0 lwz r4, 0x10(r31) mr r30, r3 stw r29, 0x0(r4) lwz r3, 0x10(r31) bl 0x31014 lwz r0, 0x2F6C(r13) cmplwi r0, 0 bne- .loc_0xDC lwz r3, 0x4(r31) lbz r0, 0x4DF(r3) cmplwi r0, 0 beq- .loc_0xDC cmpwi r30, 0 bne- .loc_0xDC lwz r4, 0x10(r31) lis r3, 0x40 addi r0, r3, 0x100 lwz r4, 0x4(r4) and. r0, r4, r0 beq- .loc_0x98 mr r3, r31 bl 0x5DC b .loc_0xDC .loc_0x98: lis r3, 0x10 addi r0, r3, 0x200 and. r0, r4, r0 beq- .loc_0xB4 mr r3, r31 bl 0x4F8 b .loc_0xDC .loc_0xB4: lwz r3, 0x28(r29) rlwinm. r0,r3,0,16,16 beq- .loc_0xCC mr r3, r31 bl 0x444 b .loc_0xDC .loc_0xCC: rlwinm. r0,r3,0,7,7 beq- .loc_0xDC mr r3, r31 bl 0x634 .loc_0xDC: mr r3, r30 .loc_0xE0: lwz r0, 0x34(r1) lwz r31, 0x2C(r1) lwz r30, 0x28(r1) lwz r29, 0x24(r1) addi r1, r1, 0x30 mtlr r0 blr */ } /* * --INFO-- * Address: 8018F440 * Size: 000178 */ void zen::ogScrDiaryMgr::draw(Graphics&) { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) stwu r1, -0x188(r1) stw r31, 0x184(r1) addi r31, r4, 0 stw r30, 0x180(r1) mr r30, r3 stw r29, 0x17C(r1) lwz r0, 0x0(r3) cmpwi r0, -0x1 beq- .loc_0x15C lwz r3, 0x4(r30) mr r4, r31 bl -0x252C lwz r0, 0x2F6C(r13) cmplwi r0, 0 bne- .loc_0x15C lwz r7, 0x310(r31) li r0, 0 lwz r6, 0x30C(r31) addi r5, r1, 0x24 addi r3, r31, 0 stw r0, 0x24(r1) addi r4, r1, 0x134 stw r0, 0x28(r1) stw r6, 0x2C(r1) stw r7, 0x30(r1) lwz r12, 0x3B4(r31) lwz r12, 0x40(r12) mtlr r12 blrl li r29, 0xFF stb r29, 0x20(r1) addi r4, r1, 0x20 addi r3, r31, 0 stb r29, 0x21(r1) li r5, 0x1 stb r29, 0x22(r1) stb r29, 0x23(r1) lwz r12, 0x3B4(r31) lwz r12, 0xA8(r12) mtlr r12 blrl stb r29, 0x1C(r1) li r0, 0x96 addi r4, r1, 0x1C stb r29, 0x1D(r1) mr r3, r31 stb r0, 0x1E(r1) stb r29, 0x1F(r1) lwz r12, 0x3B4(r31) lwz r12, 0xAC(r12) mtlr r12 blrl lwz r5, 0x4(r30) lis r3, 0x802D addi r4, r3, 0x5E0C crclr 6, 0x6 addis r3, r5, 0x1 lha r5, -0x5A64(r3) addi r3, r1, 0x34 bl 0x87064 lwz r6, 0x4(r30) mr r3, r31 lwz r12, 0x3B4(r31) crclr 6, 0x6 lha r0, 0x4D0(r6) lwz r12, 0xEC(r12) li r5, 0x1E rlwinm r0,r0,2,0,29 lwz r4, 0x14(r30) add r6, r6, r0 lwz r7, 0x1C(r6) mtlr r12 li r6, 0x14 lwz r7, 0x0(r7) blrl mr r3, r31 lwz r4, 0x14(r30) lwz r12, 0x3B4(r31) addi r7, r1, 0x34 crclr 6, 0x6 li r5, 0x1E lwz r12, 0xEC(r12) li r6, 0x28 mtlr r12 blrl .loc_0x15C: lwz r0, 0x18C(r1) lwz r31, 0x184(r1) lwz r30, 0x180(r1) lwz r29, 0x17C(r1) addi r1, r1, 0x188 mtlr r0 blr */ } /* * --INFO-- * Address: 8018F5B8 * Size: 000294 */ void zen::ogScrDiaryMgr::start(short, short) { /* .loc_0x0: mflr r0 lis r4, 0x803D stw r0, 0x4(r1) stwu r1, -0x38(r1) stw r31, 0x34(r1) addi r31, r4, 0x22E0 stw r30, 0x30(r1) addi r30, r5, 0 stw r29, 0x2C(r1) addi r29, r3, 0 stw r28, 0x28(r1) lwz r6, 0x2F6C(r13) cmplwi r6, 0 beq- .loc_0x1DC addi r3, r6, 0x70 extsh r4, r30 addi r5, r1, 0x20 bl -0x10BB88 lwz r0, 0x20(r1) cmpwi r0, 0 beq- .loc_0x274 cmpwi r0, 0x1 bne- .loc_0x74 lwz r4, 0x18(r29) li r5, 0 lbz r0, 0xC(r4) rlwimi r0,r5,7,24,24 stb r0, 0xC(r4) b .loc_0x88 .loc_0x74: lwz r4, 0x18(r29) li r5, 0x1 lbz r0, 0xC(r4) rlwimi r0,r5,7,24,24 stb r0, 0xC(r4) .loc_0x88: lwz r0, 0x20(r1) cmpwi r0, 0xA blt- .loc_0x9C li r0, 0x9 stw r0, 0x20(r1) .loc_0x9C: lwz r4, 0x20(r1) li r6, 0 cmpwi r4, 0 ble- .loc_0x1C0 cmpwi r4, 0x8 subi r5, r4, 0x8 ble- .loc_0x264 addi r0, r5, 0x7 rlwinm r0,r0,29,3,31 cmpwi r5, 0 mtctr r0 lis r4, 0x802D addi r5, r31, 0 addi r0, r4, 0x4E10 ble- .loc_0x264 .loc_0xD8: add r4, r3, r6 rlwinm r7,r4,2,0,29 add r7, r0, r7 lwz r8, 0x0(r7) addi r7, r4, 0x1 rlwinm r7,r7,2,0,29 stw r8, 0x0(r5) add r8, r0, r7 addi r7, r4, 0x2 lwz r9, 0x0(r8) rlwinm r8,r7,2,0,29 addi r7, r4, 0x3 stw r9, 0x4(r5) add r9, r0, r8 rlwinm r8,r7,2,0,29 lwz r10, 0x0(r9) addi r7, r4, 0x4 rlwinm r9,r7,2,0,29 stw r10, 0x8(r5) add r8, r0, r8 add r9, r0, r9 lwz r10, 0x0(r8) addi r7, r4, 0x5 rlwinm r8,r7,2,0,29 stw r10, 0xC(r5) addi r7, r4, 0x6 rlwinm r7,r7,2,0,29 lwz r9, 0x0(r9) addi r4, r4, 0x7 rlwinm r4,r4,2,0,29 stw r9, 0x10(r5) add r8, r0, r8 add r7, r0, r7 lwz r8, 0x0(r8) add r4, r0, r4 addi r6, r6, 0x8 stw r8, 0x14(r5) lwz r7, 0x0(r7) stw r7, 0x18(r5) lwz r4, 0x0(r4) stw r4, 0x1C(r5) addi r5, r5, 0x20 bdnz+ .loc_0xD8 b .loc_0x264 .loc_0x188: sub r0, r5, r6 lis r4, 0x802D mtctr r0 cmpw r6, r5 addi r5, r4, 0x4E10 bge- .loc_0x1C0 .loc_0x1A0: add r0, r3, r6 rlwinm r0,r0,2,0,29 add r4, r5, r0 lwz r0, 0x0(r4) addi r6, r6, 0x1 stw r0, 0x0(r7) addi r7, r7, 0x4 bdnz+ .loc_0x1A0 .loc_0x1C0: lwz r0, 0x20(r1) addi r3, r13, 0xD98 addi r4, r13, 0xD90 rlwinm r0,r0,2,0,29 stwx r3, r31, r0 lwz r3, 0x4(r29) bl -0x3234 .loc_0x1DC: li r0, 0 stw r0, 0x0(r29) li r0, 0x1 extsh r4, r30 lwz r5, 0x4(r29) li r3, 0x1 stb r0, 0x4DE(r5) bl -0xF664 lwz r3, 0x4(r29) li r4, -0x1 bl -0x3B08 lwz r3, 0x4(r29) li r4, 0 bl -0x3A94 lwz r30, 0x4(r29) lwz r28, 0xC(r29) lwz r3, 0x0(r30) lwz r31, 0x8(r29) mr r5, r28 lwz r12, 0x0(r3) mr r4, r31 lwz r12, 0x14(r12) mtlr r12 blrl lwz r3, 0x54F8(r30) addi r4, r31, 0 addi r5, r28, 0 lwz r12, 0x0(r3) lwz r12, 0x14(r12) mtlr r12 blrl lwz r3, 0x4(r29) bl -0x2FCC b .loc_0x274 .loc_0x264: rlwinm r0,r6,2,0,29 lwz r5, 0x20(r1) add r7, r31, r0 b .loc_0x188 .loc_0x274: lwz r0, 0x3C(r1) lwz r31, 0x34(r1) lwz r30, 0x30(r1) lwz r29, 0x2C(r1) lwz r28, 0x28(r1) addi r1, r1, 0x38 mtlr r0 blr */ } /* * --INFO-- * Address: ........ * Size: 00009C */ void zen::ogScrDiaryMgr::setDiarySpecialNumber(short) { // UNUSED FUNCTION } /* * --INFO-- * Address: 8018F84C * Size: 00009C */ void zen::ogScrDiaryMgr::typePage() { /* .loc_0x0: mflr r0 li r4, -0x1 stw r0, 0x4(r1) li r0, 0 stwu r1, -0x20(r1) stw r31, 0x1C(r1) stw r30, 0x18(r1) mr r30, r3 stw r29, 0x14(r1) lwz r3, 0x4(r3) stb r0, 0x4DE(r3) lwz r3, 0x4(r30) bl -0x3BC8 lwz r3, 0x4(r30) bl -0x3CEC lwz r31, 0x4(r30) lwz r29, 0xC(r30) lwz r3, 0x0(r31) lwz r30, 0x8(r30) mr r5, r29 lwz r12, 0x0(r3) mr r4, r30 lwz r12, 0x14(r12) mtlr r12 blrl lwz r3, 0x54F8(r31) addi r4, r30, 0 addi r5, r29, 0 lwz r12, 0x0(r3) lwz r12, 0x14(r12) mtlr r12 blrl lwz r0, 0x24(r1) lwz r31, 0x1C(r1) lwz r30, 0x18(r1) lwz r29, 0x14(r1) addi r1, r1, 0x20 mtlr r0 blr */ } /* * --INFO-- * Address: 8018F8E8 * Size: 0000C8 */ void zen::ogScrDiaryMgr::nextPage() { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) stwu r1, -0x28(r1) stw r31, 0x24(r1) stw r30, 0x20(r1) stw r29, 0x1C(r1) stw r28, 0x18(r1) mr r28, r3 lwz r4, 0x4(r3) lha r0, 0x4D0(r4) rlwinm r0,r0,2,0,29 add r3, r4, r0 lwz r3, 0x1C(r3) lha r0, 0x6(r3) cmpwi r0, 0x1 bgt- .loc_0x48 li r3, 0 b .loc_0xA8 .loc_0x48: li r0, 0x1 stb r0, 0x4DE(r4) lwz r3, 0x4(r28) bl -0x3BAC lwz r31, 0x4(r28) lwz r29, 0xC(r28) lwz r3, 0x0(r31) lwz r30, 0x8(r28) mr r5, r29 lwz r12, 0x0(r3) mr r4, r30 lwz r12, 0x14(r12) mtlr r12 blrl lwz r3, 0x54F8(r31) addi r4, r30, 0 addi r5, r29, 0 lwz r12, 0x0(r3) lwz r12, 0x14(r12) mtlr r12 blrl lwz r3, 0x4(r28) bl -0x3140 li r3, 0x1 .loc_0xA8: lwz r0, 0x2C(r1) lwz r31, 0x24(r1) lwz r30, 0x20(r1) lwz r29, 0x1C(r1) lwz r28, 0x18(r1) addi r1, r1, 0x28 mtlr r0 blr */ } /* * --INFO-- * Address: 8018F9B0 * Size: 0000A0 */ void zen::ogScrDiaryMgr::backPage() { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) li r0, 0x1 stwu r1, -0x20(r1) stw r31, 0x1C(r1) stw r30, 0x18(r1) stw r29, 0x14(r1) stw r28, 0x10(r1) mr r28, r3 lwz r3, 0x4(r3) stb r0, 0x4DE(r3) lwz r3, 0x4(r28) bl -0x3BF8 lwz r31, 0x4(r28) lwz r29, 0xC(r28) lwz r3, 0x0(r31) lwz r30, 0x8(r28) mr r5, r29 lwz r12, 0x0(r3) mr r4, r30 lwz r12, 0x14(r12) mtlr r12 blrl lwz r3, 0x54F8(r31) addi r4, r30, 0 addi r5, r29, 0 lwz r12, 0x0(r3) lwz r12, 0x14(r12) mtlr r12 blrl lwz r3, 0x4(r28) bl -0x31E4 lwz r0, 0x24(r1) lwz r31, 0x1C(r1) lwz r30, 0x18(r1) lwz r29, 0x14(r1) lwz r28, 0x10(r1) addi r1, r1, 0x20 mtlr r0 blr */ } /* * --INFO-- * Address: 8018FA50 * Size: 000024 */ void zen::ogScrDiaryMgr::exit() { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) stwu r1, -0x8(r1) lwz r3, 0x4(r3) bl -0x30A8 lwz r0, 0xC(r1) addi r1, r1, 0x8 mtlr r0 blr */ } /* * --INFO-- * Address: ........ * Size: 00002C */ void zen::ogScrDiaryMgr::setCursorXY(P2DTextBox*) { // UNUSED FUNCTION } /* * --INFO-- * Address: ........ * Size: 000108 */ void zen::ogScrDiaryMgr::updateDiary(Controller*) { // UNUSED FUNCTION } /* * --INFO-- * Address: 8018FA74 * Size: 000158 */ zen::ogDrawDiary::ogDrawDiary() { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) stwu r1, -0x20(r1) stw r31, 0x1C(r1) addi r31, r3, 0 li r3, 0xF8 stw r30, 0x18(r1) bl -0x148A8C addi r30, r3, 0 mr. r0, r30 beq- .loc_0x80 addi r3, r1, 0xC li r4, 0 li r5, 0 li r6, 0x280 li r7, 0x1E0 bl 0x23B74 lis r4, 0x726F addi r7, r4, 0x6F74 addi r8, r1, 0xC addi r3, r30, 0 li r4, 0 li r5, 0x8 li r6, 0x1 bl 0x20EF8 lis r3, 0x802E addi r0, r3, 0x7E0 stw r0, 0x0(r30) li r0, 0 stb r0, 0xEC(r30) stw r0, 0xF0(r30) stw r0, 0xF4(r30) .loc_0x80: stw r30, 0x10(r31) lis r3, 0x802D addi r4, r3, 0x5E1C lwz r3, 0x10(r31) li r5, 0x1 li r6, 0x1 li r7, 0x1 bl 0x230F0 lfs f0, -0x4EC8(r2) li r0, 0 li r3, 0x4C4 stfs f0, 0xC(r31) stw r0, 0x8(r31) lfs f0, 0xC(r31) lwz r4, 0x10(r31) stfs f0, 0xC0(r4) stfs f0, 0xC4(r4) stfs f0, 0xC8(r4) bl -0x148B38 addi r30, r3, 0 mr. r3, r30 beq- .loc_0xE8 li r4, 0x10 li r5, 0x400 li r6, 0x400 bl 0x59D68 .loc_0xE8: stw r30, 0x4(r31) li r3, 0x28 bl -0x148B60 addi r30, r3, 0 mr. r3, r30 beq- .loc_0x104 bl -0x980 .loc_0x104: stw r30, 0x0(r31) li r5, 0 li r4, 0x140 lfs f0, -0x4EC8(r2) li r0, 0xF0 addi r3, r31, 0 stfs f0, 0xC(r31) stw r5, 0x8(r31) lfs f0, -0x4EC4(r2) stfs f0, 0x14(r31) lfs f0, -0x4EC0(r2) stfs f0, 0x18(r31) lwz r5, 0x10(r31) sth r4, 0xB8(r5) sth r0, 0xBA(r5) lwz r0, 0x24(r1) lwz r31, 0x1C(r1) lwz r30, 0x18(r1) addi r1, r1, 0x20 mtlr r0 blr */ } /* * --INFO-- * Address: ........ * Size: 000014 */ void zen::ogDrawDiary::start() { // UNUSED FUNCTION } /* * --INFO-- * Address: ........ * Size: 0000B8 */ void zen::ogDrawDiary::setOffset() { // UNUSED FUNCTION } /* * --INFO-- * Address: 8018FBCC * Size: 000298 */ void zen::ogDrawDiary::open(float, float, short) { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) stwu r1, -0xD8(r1) stfd f31, 0xD0(r1) fmr f31, f2 stfd f30, 0xC8(r1) fmr f30, f1 stmw r25, 0xAC(r1) li r27, 0x4D addi r25, r4, 0 extsh r26, r25 addi r31, r3, 0 addi r29, r27, 0 addi r30, r27, 0 subfic r28, r26, 0x1E lwz r0, 0x2F6C(r13) cmplwi r0, 0 beq- .loc_0x68 add r3, r0, r26 lbz r27, 0x17(r3) mr r3, r0 bl -0x10EFB8 lwz r0, 0x2F6C(r13) sub r29, r3, r27 add r3, r0, r26 lbz r30, 0x35(r3) .loc_0x68: li r3, 0x1 addi r4, r26, 0 bl -0xFAF0 li r3, 0x2 addi r4, r27, 0 bl -0xFAFC li r3, 0x3 addi r4, r29, 0 bl -0xFB08 li r3, 0x4 addi r4, r28, 0 bl -0xFB14 li r3, 0x5 addi r4, r30, 0 bl -0xFB20 lwz r0, 0x8(r31) cmpwi r0, 0 bne- .loc_0x27C lfs f0, -0x4EBC(r2) li r0, 0x1 addi r5, r25, 0 stfs f0, 0xC(r31) li r4, 0 stw r0, 0x8(r31) stfs f30, 0x14(r31) stfs f31, 0x18(r31) lfs f0, 0x14(r31) stfs f0, 0x1C(r31) lfs f0, 0x18(r31) stfs f0, 0x20(r31) lfs f0, 0x14(r31) lfs f1, 0x18(r31) fctiwz f0, f0 lwz r3, 0x10(r31) fctiwz f1, f1 stfd f0, 0x98(r1) stfd f1, 0xA0(r1) lwz r0, 0x9C(r1) lwz r6, 0xA4(r1) extsh r0, r0 sth r0, 0xB8(r3) extsh r0, r6 sth r0, 0xBA(r3) lfs f0, 0x14(r31) lfs f1, 0x18(r31) fctiwz f0, f0 lwz r3, 0x0(r31) fctiwz f1, f1 lwz r3, 0x4(r3) stfd f0, 0x88(r1) lwz r6, 0x54F8(r3) stfd f1, 0x90(r1) lwz r0, 0x8C(r1) lwz r3, 0x94(r1) extsh r0, r0 sth r0, 0xB8(r6) extsh r0, r3 sth r0, 0xBA(r6) lfs f0, 0x14(r31) lfs f1, 0x18(r31) fctiwz f0, f0 lwz r3, 0x0(r31) fctiwz f1, f1 lwz r3, 0x4(r3) stfd f0, 0x78(r1) lwz r6, 0x0(r3) stfd f1, 0x80(r1) lwz r0, 0x7C(r1) lwz r3, 0x84(r1) extsh r0, r0 sth r0, 0xB8(r6) extsh r0, r3 sth r0, 0xBA(r6) lwz r3, 0x0(r31) bl -0x7A4 lfs f0, -0x4EC8(r2) addi r5, r1, 0x68 li r4, 0x4 stfs f0, 0x70(r1) li r6, 0 li r7, 0 stfs f0, 0x6C(r1) stfs f0, 0x68(r1) lfs f1, 0xD9C(r13) lfs f0, 0xDA0(r13) stfs f1, 0x68(r1) stfs f0, 0x6C(r1) lfs f0, 0xDA4(r13) stfs f0, 0x70(r1) lwz r3, 0x4(r31) bl 0x59DA0 lwz r3, 0x4(r31) addi r5, r1, 0x68 li r4, 0x5 li r6, 0 li r7, 0 bl 0x59D88 lwz r3, 0x4(r31) addi r5, r1, 0x68 li r4, 0x6 li r6, 0 li r7, 0 bl 0x59D70 lwz r3, 0x4(r31) addi r5, r1, 0x68 li r4, 0x7 li r6, 0 li r7, 0 bl 0x59D58 lwz r3, 0x4(r31) addi r5, r1, 0x68 li r4, 0x8 li r6, 0 li r7, 0 bl 0x59D40 lwz r3, 0x4(r31) addi r5, r1, 0x68 li r4, 0x9 li r6, 0 li r7, 0 bl 0x59D28 lwz r3, 0x4(r31) addi r5, r1, 0x68 li r4, 0xA li r6, 0 li r7, 0 bl 0x59D10 lwz r3, 0x4(r31) addi r5, r1, 0x68 li r4, 0xB li r6, 0 li r7, 0 bl 0x59CF8 .loc_0x27C: lmw r25, 0xAC(r1) lwz r0, 0xDC(r1) lfd f31, 0xD0(r1) lfd f30, 0xC8(r1) addi r1, r1, 0xD8 mtlr r0 blr */ } /* * --INFO-- * Address: 8018FE64 * Size: 0002B8 */ void zen::ogDrawDiary::update(Controller*) { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) stwu r1, -0xC0(r1) stfd f31, 0xB8(r1) stmw r25, 0x9C(r1) mr r30, r3 addi r31, r4, 0 lwz r3, 0x8(r3) cmpwi r3, 0 bne- .loc_0x2C b .loc_0x2A0 .loc_0x2C: cmpwi r3, 0x1 bne- .loc_0x64 lfs f1, 0xC(r30) lfs f0, -0x4EB8(r2) fmuls f0, f1, f0 stfs f0, 0xC(r30) lfs f1, 0xC(r30) lfs f0, -0x4EB4(r2) fcmpo cr0, f1, f0 cror 2, 0x1, 0x2 bne- .loc_0x64 stfs f0, 0xC(r30) li r0, 0x2 stw r0, 0x8(r30) .loc_0x64: lwz r0, 0x8(r30) cmpwi r0, 0x2 bne- .loc_0x13C lwz r3, 0x28(r31) rlwinm. r0,r3,0,18,18 beq- .loc_0x9C li r0, 0x3 stw r0, 0x8(r30) li r4, 0x1 lwz r3, 0x4(r30) bl 0x59DE4 li r3, 0x11D bl -0xEAB84 b .loc_0x13C .loc_0x9C: rlwinm. r0,r3,0,19,19 beq- .loc_0x13C lwz r25, 0x0(r30) lwz r4, 0x4(r25) lha r0, 0x4D0(r4) rlwinm r0,r0,2,0,29 add r3, r4, r0 lwz r3, 0x1C(r3) lha r0, 0x6(r3) cmpwi r0, 0x1 bgt- .loc_0xD0 li r29, 0 b .loc_0x12C .loc_0xD0: li r29, 0x1 stb r29, 0x4DE(r4) lwz r3, 0x4(r25) bl -0x41B0 lwz r28, 0x4(r25) lwz r26, 0xC(r25) lwz r3, 0x0(r28) lwz r27, 0x8(r25) mr r5, r26 lwz r12, 0x0(r3) mr r4, r27 lwz r12, 0x14(r12) mtlr r12 blrl lwz r3, 0x54F8(r28) addi r4, r27, 0 addi r5, r26, 0 lwz r12, 0x0(r3) lwz r12, 0x14(r12) mtlr r12 blrl lwz r3, 0x4(r25) bl -0x3744 .loc_0x12C: rlwinm. r0,r29,0,24,31 beq- .loc_0x13C li r3, 0x134 bl -0xEAC28 .loc_0x13C: lwz r0, 0x8(r30) cmpwi r0, 0x3 bne- .loc_0x17C lfs f1, 0xC(r30) lfs f0, -0x4EB0(r2) fmuls f0, f1, f0 stfs f0, 0xC(r30) lfs f1, 0xC(r30) lfs f0, -0x4EBC(r2) fcmpo cr0, f1, f0 cror 2, 0, 0x2 bne- .loc_0x17C lfs f0, -0x4EC8(r2) li r0, 0 stfs f0, 0xC(r30) stw r0, 0x8(r30) .loc_0x17C: lfs f0, 0x14(r30) lfs f1, 0x18(r30) fctiwz f0, f0 lwz r3, 0x10(r30) fctiwz f1, f1 stfd f0, 0x88(r1) stfd f1, 0x90(r1) lwz r0, 0x8C(r1) lwz r4, 0x94(r1) extsh r0, r0 sth r0, 0xB8(r3) extsh r0, r4 sth r0, 0xBA(r3) lfs f0, 0x14(r30) lfs f1, 0x18(r30) fctiwz f0, f0 lwz r3, 0x0(r30) fctiwz f1, f1 lwz r3, 0x4(r3) stfd f0, 0x78(r1) lwz r4, 0x54F8(r3) stfd f1, 0x80(r1) lwz r0, 0x7C(r1) lwz r3, 0x84(r1) extsh r0, r0 sth r0, 0xB8(r4) extsh r0, r3 sth r0, 0xBA(r4) lfs f0, 0x14(r30) lfs f1, 0x18(r30) fctiwz f0, f0 lwz r3, 0x0(r30) fctiwz f1, f1 lwz r3, 0x4(r3) stfd f0, 0x68(r1) lwz r4, 0x0(r3) stfd f1, 0x70(r1) lwz r0, 0x6C(r1) lwz r3, 0x74(r1) extsh r0, r0 sth r0, 0xB8(r4) extsh r0, r3 sth r0, 0xBA(r4) lfs f0, 0xC(r30) lwz r3, 0x10(r30) stfs f0, 0xC0(r3) stfs f0, 0xC4(r3) stfs f0, 0xC8(r3) lwz r3, 0x10(r30) bl 0x22AAC lwz r3, 0x0(r30) addi r4, r1, 0x34 lfs f31, 0xC(r30) mr r5, r4 lwz r26, 0x4(r3) mr r6, r4 stfs f31, 0x34(r1) lwz r3, 0x0(r26) addi r3, r3, 0xC0 bl -0x132A40 stfs f31, 0x30(r1) addi r4, r1, 0x30 addi r5, r4, 0 lwz r3, 0x54F8(r26) addi r6, r4, 0 addi r3, r3, 0xC0 bl -0x132A5C lwz r3, 0x0(r30) mr r4, r31 bl -0xDB0 lwz r3, 0x4(r30) bl 0x59A8C lwz r3, 0x8(r30) .loc_0x2A0: lmw r25, 0x9C(r1) lwz r0, 0xC4(r1) lfd f31, 0xB8(r1) addi r1, r1, 0xC0 mtlr r0 blr */ } /* * --INFO-- * Address: ........ * Size: 0001A8 */ void zen::ogDrawDiary::draw(Graphics&) { // UNUSED FUNCTION } /* * --INFO-- * Address: 8019011C * Size: 000430 */ zen::ogDrawSelectDiary::ogDrawSelectDiary() { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) stwu r1, -0x40(r1) stw r31, 0x3C(r1) addi r31, r3, 0 stw r30, 0x38(r1) stw r29, 0x34(r1) stw r28, 0x30(r1) li r28, 0 stw r28, 0x8(r3) li r3, 0xF8 stw r28, 0xC(r31) lfs f4, -0x4EB4(r2) stfs f4, 0x14(r31) fmr f2, f4 fmr f1, f4 stfs f4, 0x10(r31) fmr f0, f4 lfs f3, -0x4EC8(r2) stfs f3, 0x24(r31) stfs f3, 0x20(r31) stfs f3, 0x1C(r31) stfs f3, 0x18(r31) stfs f4, 0x2C(r31) stfs f4, 0x28(r31) stfs f2, 0x34(r31) stfs f2, 0x30(r31) stw r28, 0x38(r31) stw r28, 0x3C(r31) stfs f1, 0x44(r31) stfs f1, 0x40(r31) stfs f3, 0x54(r31) stfs f3, 0x50(r31) stfs f3, 0x4C(r31) stfs f3, 0x48(r31) stfs f0, 0x5C(r31) stfs f0, 0x58(r31) stfs f4, 0x64(r31) stfs f4, 0x60(r31) bl -0x1491B4 addi r29, r3, 0 mr. r0, r29 beq- .loc_0xFC addi r3, r1, 0x20 li r4, 0 li r5, 0 li r6, 0x280 li r7, 0x1E0 bl 0x2344C lis r4, 0x726F addi r7, r4, 0x6F74 addi r8, r1, 0x20 addi r3, r29, 0 li r4, 0 li r5, 0x8 li r6, 0x1 bl 0x207D0 lis r3, 0x802E addi r0, r3, 0x7E0 stw r0, 0x0(r29) stb r28, 0xEC(r29) stw r28, 0xF0(r29) stw r28, 0xF4(r29) .loc_0xFC: stw r29, 0x4(r31) lis r3, 0x802D addi r4, r3, 0x5E34 lwz r3, 0x4(r31) li r5, 0x1 li r6, 0x1 li r7, 0x1 bl 0x229CC li r3, 0xF8 bl -0x149238 addi r28, r3, 0 mr. r0, r28 beq- .loc_0x184 addi r3, r1, 0x18 li r4, 0 li r5, 0 li r6, 0x280 li r7, 0x1E0 bl 0x233C8 lis r4, 0x726F addi r7, r4, 0x6F74 addi r8, r1, 0x18 addi r3, r28, 0 li r4, 0 li r5, 0x8 li r6, 0x1 bl 0x2074C lis r3, 0x802E addi r0, r3, 0x7E0 stw r0, 0x0(r28) li r0, 0 stb r0, 0xEC(r28) stw r0, 0xF0(r28) stw r0, 0xF4(r28) .loc_0x184: stw r28, 0x2C4(r31) lis r3, 0x802D addi r4, r3, 0x5E4C lwz r3, 0x2C4(r31) li r5, 0 li r6, 0 li r7, 0x1 bl 0x22944 lwz r3, 0x2C4(r31) lis r4, 0x626C addi r4, r4, 0x636B lwz r12, 0x0(r3) li r5, 0x1 lwz r12, 0x34(r12) mtlr r12 blrl stw r3, 0x2C8(r31) li r0, 0xFF li r3, 0x6C lwz r4, 0x2C8(r31) stb r0, 0xF0(r4) bl -0x1492F0 addi r28, r3, 0 mr. r3, r28 beq- .loc_0x1F0 li r4, 0 bl 0x30008 .loc_0x1F0: stw r28, 0x2DC(r31) lis r3, 0x6162 addi r4, r3, 0x746E lfs f0, -0x4EAC(r2) li r5, 0x1 stfs f0, 0x31B0(r13) lwz r3, 0x4(r31) lwz r12, 0x0(r3) lwz r12, 0x34(r12) mtlr r12 blrl stw r3, 0x2CC(r31) li r3, 0x12C bl -0x14933C addi r28, r3, 0 mr. r3, r28 beq- .loc_0x240 lwz r4, 0x2CC(r31) lfs f1, -0x4EB4(r2) bl -0x11134 .loc_0x240: stw r28, 0x2D0(r31) li r3, 0x24 bl -0x149360 addi r28, r3, 0 mr. r3, r28 beq- .loc_0x25C bl -0x900 .loc_0x25C: stw r28, 0x2D4(r31) li r0, 0 addi r29, r31, 0 sth r0, 0x2E8(r31) li r28, 0 .loc_0x270: addi r5, r28, 0 crclr 6, 0x6 addi r3, r1, 0x28 addi r4, r13, 0xDA8 bl 0x861FC lwz r3, 0x4(r31) li r5, 0x1 lbz r0, 0x29(r1) lwz r12, 0x0(r3) lbz r4, 0x28(r1) rlwinm r0,r0,16,0,15 lwz r12, 0x34(r12) rlwimi r0,r4,24,0,7 lbz r6, 0x2A(r1) lbz r4, 0x2B(r1) mtlr r12 rlwimi r0,r6,8,16,23 or r4, r4, r0 blrl stw r3, 0x68(r29) li r30, 0 addi r5, r28, 0 crclr 6, 0x6 lwz r6, 0x68(r29) addi r3, r1, 0x28 lbz r0, 0xC(r6) rlwimi r0,r30,7,24,24 addi r4, r13, 0xDB0 stb r0, 0xC(r6) bl 0x86198 lwz r3, 0x4(r31) li r5, 0x1 lbz r0, 0x29(r1) lwz r12, 0x0(r3) lbz r4, 0x28(r1) rlwinm r0,r0,16,0,15 lwz r12, 0x34(r12) rlwimi r0,r4,24,0,7 lbz r6, 0x2A(r1) lbz r4, 0x2B(r1) mtlr r12 rlwimi r0,r6,8,16,23 or r4, r4, r0 blrl stw r3, 0xE0(r29) addi r5, r28, 0 addi r3, r1, 0x28 crclr 6, 0x6 lwz r6, 0xE0(r29) addi r4, r13, 0xDB8 lbz r0, 0xC(r6) rlwimi r0,r30,7,24,24 stb r0, 0xC(r6) bl 0x86138 lwz r3, 0x4(r31) li r5, 0x1 lbz r0, 0x29(r1) lwz r12, 0x0(r3) lbz r4, 0x28(r1) rlwinm r0,r0,16,0,15 lwz r12, 0x34(r12) rlwimi r0,r4,24,0,7 lbz r6, 0x2A(r1) lbz r4, 0x2B(r1) mtlr r12 rlwimi r0,r6,8,16,23 or r4, r4, r0 blrl stw r3, 0x1D0(r29) addi r3, r1, 0x28 addi r5, r28, 0xE crclr 6, 0x6 addi r4, r13, 0xDC0 bl 0x860E8 lwz r3, 0x4(r31) li r5, 0x1 lbz r0, 0x29(r1) lwz r12, 0x0(r3) lbz r4, 0x28(r1) rlwinm r0,r0,16,0,15 lwz r12, 0x34(r12) rlwimi r0,r4,24,0,7 lbz r6, 0x2A(r1) lbz r4, 0x2B(r1) mtlr r12 rlwimi r0,r6,8,16,23 or r4, r4, r0 blrl addi r28, r28, 0x1 stw r3, 0x248(r29) cmpwi r28, 0x1E addi r29, r29, 0x4 blt+ .loc_0x270 sth r30, 0x2E0(r31) li r0, -0x1 addi r3, r31, 0 sth r30, 0x2E2(r31) sth r30, 0x2E4(r31) sth r30, 0x2E6(r31) lfs f0, -0x4EC8(r2) stfs f0, 0x2EC(r31) stw r0, 0x0(r31) bl 0x1F0 mr r3, r31 lwz r0, 0x44(r1) lwz r31, 0x3C(r1) lwz r30, 0x38(r1) lwz r29, 0x34(r1) lwz r28, 0x30(r1) addi r1, r1, 0x40 mtlr r0 blr */ } /* * --INFO-- * Address: 8019054C * Size: 0001C8 */ void zen::ogDrawSelectDiary::start() { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) stwu r1, -0x48(r1) stw r31, 0x44(r1) addi r31, r3, 0 stw r30, 0x40(r1) stw r29, 0x3C(r1) lwz r0, 0x2F6C(r13) cmplwi r0, 0 beq- .loc_0x3C mr r3, r0 bl -0x10F9C8 subi r0, r3, 0x1 sth r0, 0x2E8(r31) b .loc_0x44 .loc_0x3C: li r0, 0xF sth r0, 0x2E8(r31) .loc_0x44: lha r0, 0x2E8(r31) cmpwi r0, 0 blt- .loc_0x1AC li r0, 0x1 stw r0, 0x0(r31) li r29, 0 rlwinm r0,r29,2,0,29 lfs f0, -0x4EC8(r2) li r3, 0 li r4, 0xFF stfs f0, 0x2EC(r31) add r30, r31, r0 sth r3, 0x2E0(r31) sth r3, 0x2E2(r31) sth r3, 0x2E4(r31) sth r3, 0x2E6(r31) lwz r3, 0x2C8(r31) stb r4, 0xF0(r3) .loc_0x8C: lha r0, 0x2E8(r31) cmpw r29, r0 ble- .loc_0xA8 lwz r3, 0x1D0(r30) li r4, 0x50 bl 0x2F2EC b .loc_0xB4 .loc_0xA8: lwz r3, 0x1D0(r30) li r4, 0xFF bl 0x2F2DC .loc_0xB4: addi r29, r29, 0x1 cmpwi r29, 0x1E addi r30, r30, 0x4 blt+ .loc_0x8C lha r3, 0x2E8(r31) li r5, 0 addi r3, r3, 0x1 cmpwi r3, 0x1E rlwinm r0,r3,2,0,29 add r6, r31, r0 subfic r3, r3, 0x1E bge- .loc_0x19C rlwinm. r0,r3,29,3,31 mtctr r0 beq- .loc_0x180 .loc_0xF0: lwz r4, 0x248(r6) lwz r4, 0xE0(r4) lwz r4, 0xC(r4) stb r5, 0xF0(r4) lwz r4, 0x24C(r6) lwz r4, 0xE0(r4) lwz r4, 0xC(r4) stb r5, 0xF0(r4) lwz r4, 0x250(r6) lwz r4, 0xE0(r4) lwz r4, 0xC(r4) stb r5, 0xF0(r4) lwz r4, 0x254(r6) lwz r4, 0xE0(r4) lwz r4, 0xC(r4) stb r5, 0xF0(r4) lwz r4, 0x258(r6) lwz r4, 0xE0(r4) lwz r4, 0xC(r4) stb r5, 0xF0(r4) lwz r4, 0x25C(r6) lwz r4, 0xE0(r4) lwz r4, 0xC(r4) stb r5, 0xF0(r4) lwz r4, 0x260(r6) lwz r4, 0xE0(r4) lwz r4, 0xC(r4) stb r5, 0xF0(r4) lwz r4, 0x264(r6) addi r6, r6, 0x20 lwz r4, 0xE0(r4) lwz r4, 0xC(r4) stb r5, 0xF0(r4) bdnz+ .loc_0xF0 andi. r3, r3, 0x7 beq- .loc_0x19C .loc_0x180: mtctr r3 .loc_0x184: lwz r4, 0x248(r6) addi r6, r6, 0x4 lwz r4, 0xE0(r4) lwz r4, 0xC(r4) stb r5, 0xF0(r4) bdnz+ .loc_0x184 .loc_0x19C: lwz r3, 0x2D0(r31) bl -0x11070 mr r3, r31 bl .loc_0x1C8 .loc_0x1AC: lwz r0, 0x4C(r1) lwz r31, 0x44(r1) lwz r30, 0x40(r1) lwz r29, 0x3C(r1) addi r1, r1, 0x48 mtlr r0 blr .loc_0x1C8: */ } /* * --INFO-- * Address: 80190714 * Size: 00010C */ void zen::ogDrawSelectDiary::setCursorAlpha() { /* .loc_0x0: mflr r0 lis r4, 0x726F stw r0, 0x4(r1) addi r4, r4, 0x6F74 li r5, 0x1 stwu r1, -0x68(r1) stw r31, 0x64(r1) stw r30, 0x60(r1) stw r29, 0x5C(r1) stw r28, 0x58(r1) mr r28, r3 lwz r3, 0x4(r3) lwz r12, 0x0(r3) lwz r12, 0x34(r12) mtlr r12 blrl lwz r4, 0x68(r28) mr r29, r3 lis r31, 0x7A30 lfd f2, -0x4ED0(r2) lha r3, 0x18(r4) lha r0, 0x1A(r4) lis r30, 0x4330 xoris r3, r3, 0x8000 lwz r4, 0x4(r28) stw r3, 0x54(r1) xoris r0, r0, 0x8000 stw r0, 0x4C(r1) addi r5, r29, 0 addi r3, r28, 0x8 stw r30, 0x50(r1) addi r6, r31, 0x306C stw r30, 0x48(r1) lfd f1, 0x50(r1) lfd f0, 0x48(r1) fsubs f1, f1, f2 fsubs f2, f0, f2 bl 0x4A494 lwz r6, 0xE0(r28) mr r5, r29 lfd f2, -0x4ED0(r2) addi r3, r28, 0x38 lha r4, 0x18(r6) lha r0, 0x1A(r6) addi r6, r31, 0x3072 xoris r7, r4, 0x8000 lwz r4, 0x4(r28) xoris r0, r0, 0x8000 stw r7, 0x44(r1) stw r0, 0x3C(r1) stw r30, 0x40(r1) stw r30, 0x38(r1) lfd f1, 0x40(r1) lfd f0, 0x38(r1) fsubs f1, f1, f2 fsubs f2, f0, f2 bl 0x4A448 mr r3, r28 bl .loc_0x10C lwz r0, 0x6C(r1) lwz r31, 0x64(r1) lwz r30, 0x60(r1) lwz r29, 0x5C(r1) lwz r28, 0x58(r1) addi r1, r1, 0x68 mtlr r0 blr .loc_0x10C: */ } /* * --INFO-- * Address: 80190820 * Size: 000104 */ void zen::ogDrawSelectDiary::MoveCursor() { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) stwu r1, -0x60(r1) stw r31, 0x5C(r1) mr r31, r3 stw r30, 0x58(r1) lha r0, 0x2E2(r3) lha r4, 0x2E0(r3) mulli r3, r0, 0xA lha r0, 0x2E8(r31) add r3, r4, r3 extsh r3, r3 cmpw r3, r0 ble- .loc_0x40 li r3, 0x1 b .loc_0xEC .loc_0x40: sth r3, 0x2E4(r31) lis r30, 0x4330 addi r3, r31, 0x8 lha r0, 0x2E4(r31) lfd f2, -0x4ED0(r2) rlwinm r0,r0,2,0,29 lfs f3, -0x4EA8(r2) add r4, r31, r0 lwz r5, 0x68(r4) lha r4, 0x18(r5) lha r0, 0x1A(r5) xoris r4, r4, 0x8000 xoris r0, r0, 0x8000 stw r4, 0x54(r1) stw r0, 0x4C(r1) stw r30, 0x50(r1) stw r30, 0x48(r1) lfd f1, 0x50(r1) lfd f0, 0x48(r1) fsubs f1, f1, f2 fsubs f2, f0, f2 bl 0x4A2F4 lha r0, 0x2E4(r31) addi r3, r31, 0x38 lfd f2, -0x4ED0(r2) rlwinm r0,r0,2,0,29 lfs f3, -0x4EA8(r2) add r4, r31, r0 lwz r5, 0xE0(r4) lha r4, 0x18(r5) lha r0, 0x1A(r5) xoris r4, r4, 0x8000 xoris r0, r0, 0x8000 stw r4, 0x44(r1) stw r0, 0x3C(r1) stw r30, 0x40(r1) stw r30, 0x38(r1) lfd f1, 0x40(r1) lfd f0, 0x38(r1) fsubs f1, f1, f2 fsubs f2, f0, f2 bl 0x4A2A4 li r3, 0 .loc_0xEC: lwz r0, 0x64(r1) lwz r31, 0x5C(r1) lwz r30, 0x58(r1) addi r1, r1, 0x60 mtlr r0 blr */ } /* * --INFO-- * Address: 80190924 * Size: 000880 */ void zen::ogDrawSelectDiary::update(Controller*) { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) stwu r1, -0x1A0(r1) stfd f31, 0x198(r1) stfd f30, 0x190(r1) stfd f29, 0x188(r1) stfd f28, 0x180(r1) stfd f27, 0x178(r1) stw r31, 0x174(r1) addi r31, r4, 0 stw r30, 0x170(r1) mr r30, r3 stw r29, 0x16C(r1) stw r28, 0x168(r1) lwz r3, 0x0(r3) cmpwi r3, -0x1 bne- .loc_0x48 b .loc_0x84C .loc_0x48: lwz r3, 0x2DEC(r13) lfs f1, 0x2EC(r30) lfs f0, 0x28C(r3) fadds f0, f1, f0 stfs f0, 0x2EC(r30) lwz r0, 0x0(r30) cmpwi r0, 0x4 bne- .loc_0x78 li r0, -0x1 stw r0, 0x0(r30) lwz r3, 0x0(r30) b .loc_0x84C .loc_0x78: lwz r3, 0x2DC(r30) stw r31, 0x0(r3) lwz r3, 0x2DC(r30) bl 0x2F9FC lwz r0, 0x0(r30) cmpwi r0, 0x1 bne- .loc_0xDC lfs f1, 0x2EC(r30) lfs f0, -0x4ED8(r2) fcmpo cr0, f1, f0 ble- .loc_0xB4 li r0, 0 stw r0, 0x0(r30) lwz r3, 0x0(r30) b .loc_0x84C .loc_0xB4: fdivs f0, f1, f0 lfs f1, -0x4EB4(r2) lfs f2, -0x4EA4(r2) lwz r3, 0x2C8(r30) fsubs f0, f1, f0 fmuls f0, f2, f0 fctiwz f0, f0 stfd f0, 0x160(r1) lwz r0, 0x164(r1) stb r0, 0xF0(r3) .loc_0xDC: lwz r0, 0x0(r30) cmpwi r0, 0x2 bne- .loc_0x128 lfs f1, 0x2EC(r30) lfs f0, -0x4ED8(r2) fcmpo cr0, f1, f0 ble- .loc_0x108 li r0, 0x4 stw r0, 0x0(r30) lwz r3, 0x0(r30) b .loc_0x84C .loc_0x108: fdivs f0, f1, f0 lfs f1, -0x4EA4(r2) lwz r3, 0x2C8(r30) fmuls f0, f1, f0 fctiwz f0, f0 stfd f0, 0x160(r1) lwz r0, 0x164(r1) stb r0, 0xF0(r3) .loc_0x128: lwz r0, 0x0(r30) cmpwi r0, 0 bne- .loc_0x668 lis r3, 0x100 lwz r4, 0x28(r31) addi r0, r3, 0x1000 and. r0, r4, r0 beq- .loc_0x1DC lha r6, 0x2E4(r30) lis r5, 0x4330 lfd f2, -0x4ED0(r2) rlwinm r0,r6,2,0,29 lwz r3, 0x2D4(r30) add r4, r30, r0 lwz r9, 0x1D0(r4) addi r4, r6, 0x1 lha r7, 0x18(r9) lha r0, 0x1C(r9) lha r8, 0x1A(r9) sub r6, r0, r7 lha r0, 0x1E(r9) srawi r6, r6, 0x1 addze r6, r6 sub r0, r0, r8 srawi r0, r0, 0x1 addze r0, r0 add r6, r7, r6 add r0, r8, r0 xoris r6, r6, 0x8000 xoris r0, r0, 0x8000 stw r6, 0x164(r1) stw r0, 0x15C(r1) stw r5, 0x160(r1) stw r5, 0x158(r1) lfd f1, 0x160(r1) lfd f0, 0x158(r1) fsubs f1, f1, f2 fsubs f2, f0, f2 bl -0xF18 li r3, 0x111 bl -0xEB778 li r0, 0x3 stw r0, 0x0(r30) lwz r3, 0x0(r30) b .loc_0x84C .loc_0x1DC: andi. r0, r4, 0xA000 beq- .loc_0x1FC li r0, 0x2 stw r0, 0x0(r30) lfs f0, -0x4EC8(r2) stfs f0, 0x2EC(r30) lwz r3, 0x0(r30) b .loc_0x84C .loc_0x1FC: lwz r3, 0x2DC(r30) lwz r4, 0x4(r3) rlwinm. r0,r4,0,9,9 beq- .loc_0x318 lha r3, 0x2E0(r30) cmpwi r3, 0 ble- .loc_0x318 subi r0, r3, 0x1 sth r0, 0x2E0(r30) lha r0, 0x2E2(r30) lha r4, 0x2E0(r30) mulli r3, r0, 0xA lha r0, 0x2E8(r30) add r3, r4, r3 extsh r3, r3 cmpw r3, r0 ble- .loc_0x248 li r0, 0x1 b .loc_0x2F4 .loc_0x248: sth r3, 0x2E4(r30) lis r29, 0x4330 addi r3, r30, 0x8 lha r0, 0x2E4(r30) lfd f2, -0x4ED0(r2) rlwinm r0,r0,2,0,29 lfs f3, -0x4EA8(r2) add r4, r30, r0 lwz r5, 0x68(r4) lha r4, 0x18(r5) lha r0, 0x1A(r5) xoris r4, r4, 0x8000 xoris r0, r0, 0x8000 stw r4, 0x15C(r1) stw r0, 0x164(r1) stw r29, 0x158(r1) stw r29, 0x160(r1) lfd f1, 0x158(r1) lfd f0, 0x160(r1) fsubs f1, f1, f2 fsubs f2, f0, f2 bl 0x49FE8 lha r0, 0x2E4(r30) addi r3, r30, 0x38 lfd f2, -0x4ED0(r2) rlwinm r0,r0,2,0,29 lfs f3, -0x4EA8(r2) add r4, r30, r0 lwz r5, 0xE0(r4) lha r4, 0x18(r5) lha r0, 0x1A(r5) xoris r4, r4, 0x8000 xoris r0, r0, 0x8000 stw r4, 0x154(r1) stw r0, 0x14C(r1) stw r29, 0x150(r1) stw r29, 0x148(r1) lfd f1, 0x150(r1) lfd f0, 0x148(r1) fsubs f1, f1, f2 fsubs f2, f0, f2 bl 0x49F98 li r0, 0 .loc_0x2F4: rlwinm. r0,r0,0,24,31 beq- .loc_0x30C lha r3, 0x2E0(r30) addi r0, r3, 0x1 sth r0, 0x2E0(r30) b .loc_0x650 .loc_0x30C: li r3, 0x112 bl -0xEB8C0 b .loc_0x650 .loc_0x318: rlwinm. r0,r4,0,11,11 beq- .loc_0x42C lha r3, 0x2E0(r30) cmpwi r3, 0x9 bge- .loc_0x42C addi r0, r3, 0x1 sth r0, 0x2E0(r30) lha r0, 0x2E2(r30) lha r4, 0x2E0(r30) mulli r3, r0, 0xA lha r0, 0x2E8(r30) add r3, r4, r3 extsh r3, r3 cmpw r3, r0 ble- .loc_0x35C li r0, 0x1 b .loc_0x408 .loc_0x35C: sth r3, 0x2E4(r30) lis r29, 0x4330 addi r3, r30, 0x8 lha r0, 0x2E4(r30) lfd f2, -0x4ED0(r2) rlwinm r0,r0,2,0,29 lfs f3, -0x4EA8(r2) add r4, r30, r0 lwz r5, 0x68(r4) lha r4, 0x18(r5) lha r0, 0x1A(r5) xoris r4, r4, 0x8000 xoris r0, r0, 0x8000 stw r4, 0x14C(r1) stw r0, 0x154(r1) stw r29, 0x148(r1) stw r29, 0x150(r1) lfd f1, 0x148(r1) lfd f0, 0x150(r1) fsubs f1, f1, f2 fsubs f2, f0, f2 bl 0x49ED4 lha r0, 0x2E4(r30) addi r3, r30, 0x38 lfd f2, -0x4ED0(r2) rlwinm r0,r0,2,0,29 lfs f3, -0x4EA8(r2) add r4, r30, r0 lwz r5, 0xE0(r4) lha r4, 0x18(r5) lha r0, 0x1A(r5) xoris r4, r4, 0x8000 xoris r0, r0, 0x8000 stw r4, 0x15C(r1) stw r0, 0x164(r1) stw r29, 0x158(r1) stw r29, 0x160(r1) lfd f1, 0x158(r1) lfd f0, 0x160(r1) fsubs f1, f1, f2 fsubs f2, f0, f2 bl 0x49E84 li r0, 0 .loc_0x408: rlwinm. r0,r0,0,24,31 beq- .loc_0x420 lha r3, 0x2E0(r30) subi r0, r3, 0x1 sth r0, 0x2E0(r30) b .loc_0x650 .loc_0x420: li r3, 0x112 bl -0xEB9D4 b .loc_0x650 .loc_0x42C: rlwinm. r0,r4,0,12,12 beq- .loc_0x540 lha r3, 0x2E2(r30) cmpwi r3, 0 ble- .loc_0x540 subi r0, r3, 0x1 sth r0, 0x2E2(r30) lha r0, 0x2E2(r30) lha r4, 0x2E0(r30) mulli r3, r0, 0xA lha r0, 0x2E8(r30) add r3, r4, r3 extsh r3, r3 cmpw r3, r0 ble- .loc_0x470 li r0, 0x1 b .loc_0x51C .loc_0x470: sth r3, 0x2E4(r30) lis r29, 0x4330 addi r3, r30, 0x8 lha r0, 0x2E4(r30) lfd f2, -0x4ED0(r2) rlwinm r0,r0,2,0,29 lfs f3, -0x4EA8(r2) add r4, r30, r0 lwz r5, 0x68(r4) lha r4, 0x18(r5) lha r0, 0x1A(r5) xoris r4, r4, 0x8000 xoris r0, r0, 0x8000 stw r4, 0x14C(r1) stw r0, 0x154(r1) stw r29, 0x148(r1) stw r29, 0x150(r1) lfd f1, 0x148(r1) lfd f0, 0x150(r1) fsubs f1, f1, f2 fsubs f2, f0, f2 bl 0x49DC0 lha r0, 0x2E4(r30) addi r3, r30, 0x38 lfd f2, -0x4ED0(r2) rlwinm r0,r0,2,0,29 lfs f3, -0x4EA8(r2) add r4, r30, r0 lwz r5, 0xE0(r4) lha r4, 0x18(r5) lha r0, 0x1A(r5) xoris r4, r4, 0x8000 xoris r0, r0, 0x8000 stw r4, 0x15C(r1) stw r0, 0x164(r1) stw r29, 0x158(r1) stw r29, 0x160(r1) lfd f1, 0x158(r1) lfd f0, 0x160(r1) fsubs f1, f1, f2 fsubs f2, f0, f2 bl 0x49D70 li r0, 0 .loc_0x51C: rlwinm. r0,r0,0,24,31 beq- .loc_0x534 lha r3, 0x2E2(r30) addi r0, r3, 0x1 sth r0, 0x2E2(r30) b .loc_0x650 .loc_0x534: li r3, 0x112 bl -0xEBAE8 b .loc_0x650 .loc_0x540: rlwinm. r0,r4,0,10,10 beq- .loc_0x650 lha r3, 0x2E2(r30) cmpwi r3, 0x2 bge- .loc_0x650 addi r0, r3, 0x1 sth r0, 0x2E2(r30) lha r0, 0x2E2(r30) lha r4, 0x2E0(r30) mulli r3, r0, 0xA lha r0, 0x2E8(r30) add r3, r4, r3 extsh r3, r3 cmpw r3, r0 ble- .loc_0x584 li r0, 0x1 b .loc_0x630 .loc_0x584: sth r3, 0x2E4(r30) lis r29, 0x4330 addi r3, r30, 0x8 lha r0, 0x2E4(r30) lfd f2, -0x4ED0(r2) rlwinm r0,r0,2,0,29 lfs f3, -0x4EA8(r2) add r4, r30, r0 lwz r5, 0x68(r4) lha r4, 0x18(r5) lha r0, 0x1A(r5) xoris r4, r4, 0x8000 xoris r0, r0, 0x8000 stw r4, 0x14C(r1) stw r0, 0x154(r1) stw r29, 0x148(r1) stw r29, 0x150(r1) lfd f1, 0x148(r1) lfd f0, 0x150(r1) fsubs f1, f1, f2 fsubs f2, f0, f2 bl 0x49CAC lha r0, 0x2E4(r30) addi r3, r30, 0x38 lfd f2, -0x4ED0(r2) rlwinm r0,r0,2,0,29 lfs f3, -0x4EA8(r2) add r4, r30, r0 lwz r5, 0xE0(r4) lha r4, 0x18(r5) lha r0, 0x1A(r5) xoris r4, r4, 0x8000 xoris r0, r0, 0x8000 stw r4, 0x15C(r1) stw r0, 0x164(r1) stw r29, 0x158(r1) stw r29, 0x160(r1) lfd f1, 0x158(r1) lfd f0, 0x160(r1) fsubs f1, f1, f2 fsubs f2, f0, f2 bl 0x49C5C li r0, 0 .loc_0x630: rlwinm. r0,r0,0,24,31 beq- .loc_0x648 lha r3, 0x2E2(r30) subi r0, r3, 0x1 sth r0, 0x2E2(r30) b .loc_0x650 .loc_0x648: li r3, 0x112 bl -0xEBBFC .loc_0x650: addi r3, r30, 0x8 bl 0x4989C addi r3, r30, 0x38 bl 0x49894 lwz r3, 0x2D0(r30) bl -0x11840 .loc_0x668: lwz r3, 0x4(r30) bl 0x21BC0 lwz r3, 0x2D4(r30) mr r4, r31 bl -0x1138 stw r3, 0x2D8(r30) lwz r3, 0x2C4(r30) bl 0x21BA8 lha r3, 0x2E8(r30) li r5, 0 addi r3, r3, 0x1 cmpwi r3, 0x1E rlwinm r0,r3,2,0,29 add r6, r30, r0 subfic r3, r3, 0x1E bge- .loc_0x760 rlwinm. r0,r3,29,3,31 mtctr r0 beq- .loc_0x744 .loc_0x6B4: lwz r4, 0x248(r6) lwz r4, 0xE0(r4) lwz r4, 0xC(r4) stb r5, 0xF0(r4) lwz r4, 0x24C(r6) lwz r4, 0xE0(r4) lwz r4, 0xC(r4) stb r5, 0xF0(r4) lwz r4, 0x250(r6) lwz r4, 0xE0(r4) lwz r4, 0xC(r4) stb r5, 0xF0(r4) lwz r4, 0x254(r6) lwz r4, 0xE0(r4) lwz r4, 0xC(r4) stb r5, 0xF0(r4) lwz r4, 0x258(r6) lwz r4, 0xE0(r4) lwz r4, 0xC(r4) stb r5, 0xF0(r4) lwz r4, 0x25C(r6) lwz r4, 0xE0(r4) lwz r4, 0xC(r4) stb r5, 0xF0(r4) lwz r4, 0x260(r6) lwz r4, 0xE0(r4) lwz r4, 0xC(r4) stb r5, 0xF0(r4) lwz r4, 0x264(r6) addi r6, r6, 0x20 lwz r4, 0xE0(r4) lwz r4, 0xC(r4) stb r5, 0xF0(r4) bdnz+ .loc_0x6B4 andi. r3, r3, 0x7 beq- .loc_0x760 .loc_0x744: mtctr r3 .loc_0x748: lwz r4, 0x248(r6) addi r6, r6, 0x4 lwz r4, 0xE0(r4) lwz r4, 0xC(r4) stb r5, 0xF0(r4) bdnz+ .loc_0x748 .loc_0x760: lfs f27, -0x4EB4(r2) mr r28, r30 lfs f28, -0x4EA0(r2) li r31, 0 lfd f29, -0x4ED0(r2) lfs f30, -0x4E98(r2) lis r29, 0x4330 lfs f31, -0x4E9C(r2) b .loc_0x81C .loc_0x784: lfs f0, 0x2EC(r30) fcmpo cr0, f0, f27 fmr f1, f0 cror 2, 0x1, 0x2 bne- .loc_0x79C fsubs f1, f1, f27 .loc_0x79C: xoris r0, r31, 0x8000 stw r0, 0x14C(r1) stw r29, 0x148(r1) lfd f0, 0x148(r1) fsubs f0, f0, f29 fmuls f0, f28, f0 fsubs f1, f1, f0 fmuls f1, f30, f1 bl 0x8AC08 lwz r5, 0x1D0(r28) fmuls f0, f31, f1 addi r31, r31, 0x1 lha r3, 0x18(r5) lha r0, 0x1C(r5) fadds f0, f27, f0 lha r4, 0x1A(r5) sub r0, r0, r3 lha r3, 0x1E(r5) srawi r0, r0, 0x1 addze r0, r0 sub r4, r3, r4 extsh r3, r0 srawi r0, r4, 0x1 sth r3, 0xB8(r5) addze r0, r0 extsh r0, r0 sth r0, 0xBA(r5) lwz r3, 0x1D0(r28) addi r28, r28, 0x4 stfs f0, 0xC0(r3) stfs f0, 0xC4(r3) stfs f0, 0xC8(r3) .loc_0x81C: lha r0, 0x2E8(r30) cmpw r31, r0 ble+ .loc_0x784 lwz r0, 0x0(r30) cmpwi r0, 0x3 bne- .loc_0x848 lwz r0, 0x2D8(r30) cmpwi r0, 0 bne- .loc_0x848 li r0, 0 stw r0, 0x0(r30) .loc_0x848: lwz r3, 0x0(r30) .loc_0x84C: lwz r0, 0x1A4(r1) lfd f31, 0x198(r1) lfd f30, 0x190(r1) lfd f29, 0x188(r1) lfd f28, 0x180(r1) lfd f27, 0x178(r1) lwz r31, 0x174(r1) lwz r30, 0x170(r1) lwz r29, 0x16C(r1) lwz r28, 0x168(r1) addi r1, r1, 0x1A0 mtlr r0 blr */ } /* * --INFO-- * Address: 801911A4 * Size: 0000F0 */ void zen::ogDrawSelectDiary::draw(Graphics&) { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) stwu r1, -0x108(r1) stw r31, 0x104(r1) stw r30, 0x100(r1) addi r30, r4, 0 stw r29, 0xFC(r1) mr r29, r3 lwz r0, 0x0(r3) cmpwi r0, -0x1 beq- .loc_0xD4 lfs f1, -0x4E94(r2) addi r3, r1, 0x10 lfs f2, -0x4EB4(r2) li r4, 0 lfs f3, -0x4E90(r2) li r5, 0 li r6, 0x280 li r7, 0x1E0 bl 0x1EFA0 addi r3, r1, 0x10 bl 0x1F0A8 lwz r3, 0x4(r29) addi r6, r1, 0x10 li r4, 0 li r5, 0 bl 0x21CC8 lwz r31, 0x2D4(r29) lwz r0, 0x8(r31) cmpwi r0, 0 beq- .loc_0xA8 lwz r3, 0x10(r31) li r4, 0 li r5, 0 li r6, 0 bl 0x21CA4 lwz r3, 0x4(r31) mr r4, r30 bl 0x58970 lwz r3, 0x0(r31) mr r4, r30 bl -0x1E08 .loc_0xA8: lwz r3, 0x2C4(r29) addi r6, r1, 0x10 li r4, 0 li r5, 0 bl 0x21C78 lis r3, 0x802E addi r0, r3, 0x698 lis r3, 0x802E stw r0, 0x10(r1) addi r0, r3, 0x5D4 stw r0, 0x10(r1) .loc_0xD4: lwz r0, 0x10C(r1) lwz r31, 0x104(r1) lwz r30, 0x100(r1) lwz r29, 0xFC(r1) addi r1, r1, 0x108 mtlr r0 blr */ } ======================= File: src/plugPikiKando/aiStone.cpp ======================= #include "types.h" /* * --INFO-- * Address: ........ * Size: 00009C */ void _Error(char*,...) { // UNUSED FUNCTION } /* * --INFO-- * Address: ........ * Size: 0000F0 */ void _Print(char*,...) { // UNUSED FUNCTION } /* * --INFO-- * Address: 800A6D94 * Size: 000054 */ ActStone::ActStone(Piki*) { /* .loc_0x0: mflr r0 li r5, 0x1 stw r0, 0x4(r1) stwu r1, -0x18(r1) stw r31, 0x14(r1) addi r31, r3, 0 bl 0x1D024 lis r3, 0x802B subi r0, r3, 0x246C lis r3, 0x802B stw r0, 0x14(r31) addi r3, r3, 0x4FB0 stw r3, 0x0(r31) addi r0, r3, 0x64 addi r3, r31, 0 stw r0, 0x14(r31) lwz r0, 0x1C(r1) lwz r31, 0x14(r1) addi r1, r1, 0x18 mtlr r0 blr */ } /* * --INFO-- * Address: 800A6DE8 * Size: 000058 */ void ActStone::init(Creature*) { /* .loc_0x0: mflr r0 cmplwi r4, 0 stw r0, 0x4(r1) li r0, 0 stwu r1, -0x18(r1) stw r31, 0x14(r1) addi r31, r3, 0 stw r0, 0x20(r3) beq- .loc_0x3C lwz r0, 0x6C(r4) cmpwi r0, 0x21 bne- .loc_0x3C stw r4, 0x24(r31) lwz r3, 0x24(r31) bl 0x3D87C .loc_0x3C: mr r3, r31 bl 0xD8 lwz r0, 0x1C(r1) lwz r31, 0x14(r1) addi r1, r1, 0x18 mtlr r0 blr */ } /* * --INFO-- * Address: 800A6E40 * Size: 000074 */ void ActStone::exec() { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) stwu r1, -0x8(r1) lwz r0, 0x20(r3) cmplwi r0, 0 bne- .loc_0x20 li r3, 0x2 b .loc_0x64 .loc_0x20: lhz r0, 0x18(r3) cmpwi r0, 0x1 beq- .loc_0x50 bge- .loc_0x3C cmpwi r0, 0 bge- .loc_0x48 b .loc_0x60 .loc_0x3C: cmpwi r0, 0x3 bge- .loc_0x60 b .loc_0x58 .loc_0x48: bl 0xFC b .loc_0x64 .loc_0x50: bl 0x290 b .loc_0x64 .loc_0x58: bl 0x4E0 b .loc_0x64 .loc_0x60: li r3, 0 .loc_0x64: lwz r0, 0xC(r1) addi r1, r1, 0x8 mtlr r0 blr */ } /* * --INFO-- * Address: 800A6EB4 * Size: 00004C */ void ActStone::cleanup() { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) stwu r1, -0x8(r1) lwz r4, 0xC(r3) lwz r0, 0xC8(r4) rlwinm r0,r0,0,10,8 stw r0, 0xC8(r4) lwz r4, 0xC(r3) lwz r0, 0xC8(r4) rlwinm r0,r0,0,11,9 stw r0, 0xC8(r4) lwz r3, 0x24(r3) cmplwi r3, 0 beq- .loc_0x3C bl 0x3D7C8 .loc_0x3C: lwz r0, 0xC(r1) addi r1, r1, 0x8 mtlr r0 blr */ } /* * --INFO-- * Address: 800A6F00 * Size: 000084 */ void ActStone::initApproach() { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) stwu r1, -0x28(r1) stw r31, 0x24(r1) stw r30, 0x20(r1) mr r30, r3 lwz r3, 0x24(r3) cmplwi r3, 0 beq- .loc_0x30 bl 0x3E2E4 stw r3, 0x20(r30) b .loc_0x38 .loc_0x30: li r0, 0 stw r0, 0x20(r30) .loc_0x38: li r0, 0 sth r0, 0x18(r30) addi r3, r1, 0xC li r4, 0x2 bl 0x78010 addi r31, r3, 0 addi r3, r1, 0x14 li r4, 0x2 bl 0x78000 mr r4, r3 lwz r3, 0xC(r30) mr r5, r31 bl 0x23A70 lwz r0, 0x2C(r1) lwz r31, 0x24(r1) lwz r30, 0x20(r1) addi r1, r1, 0x28 mtlr r0 blr */ } /* * --INFO-- * Address: 800A6F84 * Size: 000190 */ void ActStone::exeApproach() { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) stwu r1, -0x68(r1) stfd f31, 0x60(r1) stw r31, 0x5C(r1) mr r31, r3 lwz r4, 0x20(r3) cmplwi r4, 0 beq- .loc_0x30 lbz r0, 0xE(r4) cmplwi r0, 0 bne- .loc_0x44 .loc_0x30: lwz r4, 0xC(r31) li r0, 0x1 li r3, 0x1 stb r0, 0x400(r4) b .loc_0x178 .loc_0x44: lwz r3, 0xC(r31) lfsu f0, 0x94(r3) lfs f1, 0x0(r4) lfs f3, 0x4(r4) lfs f2, 0x4(r3) fsubs f0, f1, f0 lfs f4, 0x8(r4) lfs f1, 0x8(r3) fsubs f2, f3, f2 stfs f0, 0x48(r1) fsubs f0, f4, f1 stfs f2, 0x4C(r1) stfs f0, 0x50(r1) lfs f0, 0x48(r1) lfs f1, 0x50(r1) fmuls f2, f0, f0 lfs f0, -0x71F0(r2) fmuls f1, f1, f1 fadds f31, f2, f1 fcmpo cr0, f31, f0 ble- .loc_0xF0 fsqrte f1, f31 lfd f3, -0x71E8(r2) lfd f2, -0x71E0(r2) fmul f0, f1, f1 fmul f1, f3, f1 fmul f0, f31, f0 fsub f0, f2, f0 fmul f1, f1, f0 fmul f0, f1, f1 fmul f1, f3, f1 fmul f0, f31, f0 fsub f0, f2, f0 fmul f1, f1, f0 fmul f0, f1, f1 fmul f1, f3, f1 fmul f0, f31, f0 fsub f0, f2, f0 fmul f0, f1, f0 fmul f0, f31, f0 frsp f0, f0 stfs f0, 0x2C(r1) lfs f31, 0x2C(r1) .loc_0xF0: lfs f1, 0x48(r1) lfs f0, 0x4C(r1) fmuls f1, f1, f1 lfs f2, 0x50(r1) fmuls f0, f0, f0 fmuls f2, f2, f2 fadds f0, f1, f0 fadds f1, f2, f0 bl -0x99454 lfs f0, -0x71F0(r2) fcmpu cr0, f0, f1 beq- .loc_0x144 lfs f0, 0x48(r1) fdivs f0, f0, f1 stfs f0, 0x48(r1) lfs f0, 0x4C(r1) fdivs f0, f0, f1 stfs f0, 0x4C(r1) lfs f0, 0x50(r1) fdivs f0, f0, f1 stfs f0, 0x50(r1) .loc_0x144: lfs f0, -0x71D8(r2) fcmpo cr0, f31, f0 cror 2, 0, 0x2 bne- .loc_0x164 mr r3, r31 bl .loc_0x190 li r3, 0 b .loc_0x178 .loc_0x164: lwz r3, 0xC(r31) addi r4, r1, 0x48 lfs f1, -0x71D4(r2) bl 0x24CE4 li r3, 0 .loc_0x178: lwz r0, 0x6C(r1) lfd f31, 0x60(r1) lwz r31, 0x5C(r1) addi r1, r1, 0x68 mtlr r0 blr .loc_0x190: */ } /* * --INFO-- * Address: 800A7114 * Size: 00000C */ void ActStone::initAdjust() { // Generated from sth r0, 0x18(r3) _18 = 1; } /* * --INFO-- * Address: 800A7120 * Size: 0001C4 */ void ActStone::exeAdjust() { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) stwu r1, -0x68(r1) stfd f31, 0x60(r1) stw r31, 0x5C(r1) mr r31, r3 lwz r4, 0x20(r3) cmplwi r4, 0 beq- .loc_0x30 lbz r0, 0xE(r4) cmplwi r0, 0 bne- .loc_0x44 .loc_0x30: lwz r4, 0xC(r31) li r0, 0x1 li r3, 0x1 stb r0, 0x400(r4) b .loc_0x1AC .loc_0x44: lwz r3, 0xC(r31) lfsu f0, 0x94(r3) lfs f1, 0x0(r4) lfs f3, 0x4(r4) lfs f2, 0x4(r3) fsubs f0, f1, f0 lfs f4, 0x8(r4) lfs f1, 0x8(r3) fsubs f2, f3, f2 stfs f0, 0x48(r1) fsubs f0, f4, f1 stfs f2, 0x4C(r1) stfs f0, 0x50(r1) lfs f0, 0x48(r1) lfs f1, 0x50(r1) fmuls f2, f0, f0 lfs f0, -0x71F0(r2) fmuls f1, f1, f1 fadds f31, f2, f1 fcmpo cr0, f31, f0 ble- .loc_0xF0 fsqrte f1, f31 lfd f3, -0x71E8(r2) lfd f2, -0x71E0(r2) fmul f0, f1, f1 fmul f1, f3, f1 fmul f0, f31, f0 fsub f0, f2, f0 fmul f1, f1, f0 fmul f0, f1, f1 fmul f1, f3, f1 fmul f0, f31, f0 fsub f0, f2, f0 fmul f1, f1, f0 fmul f0, f1, f1 fmul f1, f3, f1 fmul f0, f31, f0 fsub f0, f2, f0 fmul f0, f1, f0 fmul f0, f31, f0 frsp f0, f0 stfs f0, 0x2C(r1) lfs f31, 0x2C(r1) .loc_0xF0: lfs f1, 0x48(r1) lfs f0, 0x4C(r1) fmuls f1, f1, f1 lfs f2, 0x50(r1) fmuls f0, f0, f0 fmuls f2, f2, f2 fadds f0, f1, f0 fadds f1, f2, f0 bl -0x995F0 lfs f0, -0x71F0(r2) fcmpu cr0, f0, f1 beq- .loc_0x144 lfs f0, 0x48(r1) fdivs f0, f0, f1 stfs f0, 0x48(r1) lfs f0, 0x4C(r1) fdivs f0, f0, f1 stfs f0, 0x4C(r1) lfs f0, 0x50(r1) fdivs f0, f0, f1 stfs f0, 0x50(r1) .loc_0x144: lfs f0, -0x71D0(r2) fcmpo cr0, f31, f0 bge- .loc_0x198 mr r3, r31 bl .loc_0x1C4 lwz r4, 0xC(r31) li r3, 0 lfs f0, -0x50F0(r13) stfsu f0, 0xA4(r4) lfs f0, -0x50EC(r13) stfs f0, 0x4(r4) lfs f0, -0x50E8(r13) stfs f0, 0x8(r4) lwz r4, 0xC(r31) lfs f0, -0x50E4(r13) stfsu f0, 0x70(r4) lfs f0, -0x50E0(r13) stfs f0, 0x4(r4) lfs f0, -0x50DC(r13) stfs f0, 0x8(r4) b .loc_0x1AC .loc_0x198: lwz r3, 0xC(r31) addi r4, r1, 0x48 lfs f1, -0x71CC(r2) bl 0x24B14 li r3, 0 .loc_0x1AC: lwz r0, 0x6C(r1) lfd f31, 0x60(r1) lwz r31, 0x5C(r1) addi r1, r1, 0x68 mtlr r0 blr .loc_0x1C4: */ } /* * --INFO-- * Address: 800A72E4 * Size: 000094 */ void ActStone::initAttack() { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) li r0, 0x2 stwu r1, -0x30(r1) stw r31, 0x2C(r1) stw r30, 0x28(r1) stw r29, 0x24(r1) mr. r29, r3 sth r0, 0x18(r3) mr r30, r29 beq- .loc_0x30 addi r30, r30, 0x14 .loc_0x30: addi r3, r1, 0x10 li r4, 0x13 bl 0x77C3C addi r31, r3, 0 addi r5, r30, 0 addi r3, r1, 0x18 li r4, 0x13 bl 0x77C5C mr r4, r3 lwz r3, 0xC(r29) mr r5, r31 bl 0x23698 li r0, 0 stb r0, 0x28(r29) lwz r3, 0xC(r29) lwz r0, 0xC8(r3) oris r0, r0, 0x40 stw r0, 0xC8(r3) lwz r0, 0x34(r1) lwz r31, 0x2C(r1) lwz r30, 0x28(r1) lwz r29, 0x24(r1) addi r1, r1, 0x30 mtlr r0 blr */ } /* * --INFO-- * Address: 800A7378 * Size: 000174 */ void ActStone::exeAttack() { /* .loc_0x0: mflr r0 stw r0, 0x4(r1) stwu r1, -0x48(r1) stw r31, 0x44(r1) mr r31, r3 stw r30, 0x40(r1) stw r29, 0x3C(r1) lwz r3, 0x20(r3) lbz r0, 0xE(r3) cmplwi r0, 0 bne- .loc_0xA8 lwz r3, 0xC(r31) lwz r0, 0xC8(r3) rlwinm r0,r0,0,10,8 stw r0, 0xC8(r3) lwz r3, 0xC(r31) lwz r0, 0xC8(r3) rlwinm r0,r0,0,11,9 stw r0, 0xC8(r3) lwz r3, 0x24(r31) cmplwi r3, 0 beq- .loc_0x64 bl 0x3DE38 stw r3, 0x20(r31) b .loc_0x6C .loc_0x64: li r0, 0 stw r0, 0x20(r31) .loc_0x6C: li r0, 0 sth r0, 0x18(r31) addi r3, r1, 0x28 li r4, 0x2 bl 0x77B64 addi r30, r3, 0 addi r3, r1, 0x20 li r4, 0x2 bl 0x77B54 mr r4, r3 lwz r3, 0xC(r31) mr r5, r30 bl 0x235C4 li r3, 0 b .loc_0x158 .loc_0xA8: lwz r3, 0xC(r31) lfs f0, -0x50D8(r13)
70,630