고급 프로그래밍을 하다 보면 작은 코드 조각도 큰 의미를 가질 때가 있다. 그런 의미로 여기를 운영하고 내가 다 경험했거나 경험하고 있거나 경험할 것들이다. 나 자신도 많이 이용 한다.

 

그리고 나의 티스토리를 방문해 주는 분 중에 어둠 속에 있는 팬 들이 몇 있다. 그리고 이 곳은 국내 서비스.

 

이런 연유로 이쪽으로 모든 블로그를 정리하고 모두 통합을 하고 있다. 문제는 내가 글을 올리는 시점이랑 본래 쓰여져 있던 글의 시점이 다르다. 작게는 며칠이겠으나, 많게는 수년에서 10년 이상 차이나는 경우가 있다는 것이다. 그렇다고 내가 일일이 시점을 밝히지는 않는다.

 

그리고 다시 쓰여지는 것은 고친 후 이제 현재 날짜로 올리기로 했다. 이에, 독자들은 가장 최근의 글만 읽으면 되고 나머지는 그냥 검색으로 찾아 보면 된다는 것이다. 일부러 보기 어렵게 만들어 두는 것도 있다. 정말 그 조각이라도 필요한 사람은 그 의미를 알 것 이다. 개인적으로 부끄럽지만 올려야 하는 마음도 조금.

 

================================================================= Main Thread Checker: UI API called on a background thread: -[UIView frame] PID: 592, TID: 84549, Thread name: (none), Queue name: com.apple.root.user-initiated-qos, QoS: 25 Backtrace: 4 SwiftOCR Camera 0x0000000104a11224 $s15SwiftOCR_Camera14ViewControllerC21prepareCaptureSession33_D2B5D49B4989BA76DD67FCF48F6F274FLLyyF + 864 5 SwiftOCR Camera 0x0000000104a10eb4 $s15SwiftOCR_Camera14ViewControllerC09configureC6ForUse33_D2B5D49B4989BA76DD67FCF48F6F274FLLyyFyycfU_ + 60 6 SwiftOCR Camera 0x0000000104a0c948 $sIeg_IeyB_TR + 56 7 libdispatch.dylib 0x000000010503d7fc _dispatch_call_block_and_release + 24 8 libdispatch.dylib 0x000000010503ebd8 _dispatch_client_callout + 16 9 libdispatch.dylib 0x00000001050502b4 _dispatch_root_queue_drain + 716 10 libdispatch.dylib 0x0000000105050a88 _dispatch_worker_thread2 + 156 11 libsystem_pthread.dylib 0x0000000198456b48 _pthread_wqthread + 212 12 libsystem_pthread.dylib 0x0000000198459760 start_wqthread + 8 2020-05-11 12:28:38.852935+0900 SwiftOCR Camera[592:84549] [reports] Main Thread Checker: UI API called on a background thread: -[UIView frame] PID: 592, TID: 84549, Thread name: (none), Queue name: com.apple.root.user-initiated-qos, QoS: 25 Backtrace: 4 SwiftOCR Camera 0x0000000104a11224 $s15SwiftOCR_Camera14ViewControllerC21prepareCaptureSession33_D2B5D49B4989BA76DD67FCF48F6F274FLLyyF + 864 5 SwiftOCR Camera 0x0000000104a10eb4 $s15SwiftOCR_Camera14ViewControllerC09configureC6ForUse33_D2B5D49B4989BA76DD67FCF48F6F274FLLyyFyycfU_ + 60 6 SwiftOCR Camera 0x0000000104a0c948 $sIeg_IeyB_TR + 56 7 libdispatch.dylib 0x000000010503d7fc _dispatch_call_block_and_release + 24 8 libdispatch.dylib 0x000000010503ebd8 _dispatch_client_callout + 16 9 libdispatch.dylib 0x00000001050502b4 _dispatch_root_queue_drain + 716 10 libdispatch.dylib 0x0000000105050a88 _dispatch_worker_thread2 + 156 11 libsystem_pthread.dylib 0x0000000198456b48 _pthread_wqthread + 212 12 libsystem_pthread.dylib 0x0000000198459760 start_wqthread + 8 2020-05-11 12:29:11.058584+0900 SwiftOCR Camera[592:84693] Metal API Validation Enabled [SwiftOCR.SwiftOCRRecognizedBlob(charactersWithConfidence: Optional([(character: "N", confidence: 0.020994838), (character: "1", confidence: 0.006665211), (character: "W", confidence: 0.004849366), (character: "M", confidence: 0.0028723874), (character: "4", confidence: 0.0015253571), (character: "Q", confidence: 0.001506645), (character: "V", confidence: 0.0014867398), (character: "H", confidence: 0.0012750074)]), boundingBox: Optional((141.0, 34.0, 92.0, 56.0))), SwiftOCR.SwiftOCRRecognizedBlob(charactersWithConfidence: Optional([(character: "I", confidence: 0.4291106), (character: "5", confidence: 0.013604074)]), boundingBox: Optional((374.0, 39.0, 8.0, 23.0))), SwiftOCR.SwiftOCRRecognizedBlob(charactersWithConfidence: Optional([(character: "I", confidence: 0.36353746), (character: "K", confidence: 0.026219416)]), boundingBox: Optional((378.0, 83.0, 8.0, 16.0)))] The domain is already assigned as a Main domain in your account http://box5699.temp.domains/~audreyi0 // [FileManager clearDirImages]; #import "RCEasyTipView.h" #import "ConfirmationEditor.h" #import "QualityControl.h" #import "PresentCondition.h" #import <QuartzCore/QuartzCore.h> #import "GlobalVar.h" #import "Entity.h" #import "SqlUtils.h" #import "SuperAddressSelector.h" #import "DCH_BsQtChkEdtg.h" #import "DCH_BsQtChk.h" @implementation PresentCondition @synthesize mTableView, mLblHosh, mlblStatstics, mFlag, mChkAll; @synthesize mListSearchingResult, mainPanel; //@synthesize mDate1, mDate2; /* - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } */ - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } #pragma mark - View lifecycle static void oldOne(PresentCondition *object) { [[object->_btnSort layer] setBorderColor:[UIColor colorWithRed:177/255 green:137/255 blue:167/255 alpha:1].CGColor]; [[object->_btnSort layer] setBorderWidth:0.0]; [[object.btnSiteInfo layer] setBorderWidth:1.0f]; [[object.btnSiteInfo layer] setCornerRadius:8.0f]; [[object.btnSiteInfo layer] setMasksToBounds:YES]; // [[self.btnSiteInfo layer] setBorderColor:[UIColor colorWithRed:246/255 green:135/255 blue:38/255 alpha:1].CGColor]; [[object.btnSiteInfo layer] setBorderColor:UIColor.orangeColor.CGColor]; [object->mLblHosh setText:GlobalVar.globalVar.userSelectionSiteInformation.nm_site]; // NSLog(@"btnSiteInfo %@", GlobalVar.globalVar.userSelectionSiteInformation.nm_prgs_phs); sqlite3 *database; NSString *databaseName = @"mbass.db";;;;;;;;;;;;;;;;;;;; NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);;;;;;;;;;;;;; NSString *documentsDir = [documentPaths objectAtIndex:0];;;;;;;;;;;;;;;;;;;; NSString *databasePath = [documentsDir stringByAppendingPathComponent:databaseName];;;;;;;;;;;; NSString *currentProgressString = @""; if(sqlite3_open([databasePath UTF8String], &database) == SQLITE_OK) { NSString *query = @"select nm_prgs_phs \ from ddtbt_site;"; const char *sqlStatement = [query cStringUsingEncoding:NSASCIIStringEncoding]; sqlite3_stmt *compiledStatement; if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK) { // Loop through the results and add them to the feeds array while(sqlite3_step(compiledStatement) == SQLITE_ROW) { currentProgressString = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 0)]; break; } } sqlite3_finalize(compiledStatement);;;;;;;;;;;;;;;;;;;;;;;;;; } sqlite3_close(database);;;;;;;;;;;;;;;;;;;;;;;;;;;; [object.btnSiteInfo setTitle:currentProgressString forState:UIControlStateNormal ]; object->_nflagRefreshStat = true; [object initializeControls]; [object initActivityIndicator]; [object initializeData]; } - (void)setAnchorPoint:(CGPoint)anchorPoint forView:(UIView *)view { // sanity check - x and y MUST be between 0 and 1 if (anchorPoint.x < 0 || anchorPoint.x > 1 || anchorPoint.y < 0 || anchorPoint.y > 1) { return; } CGPoint newPoint = CGPointMake(view.bounds.size.width * anchorPoint.x, view.bounds.size.height * anchorPoint.y); CGPoint oldPoint = CGPointMake(view.bounds.size.width * view.layer.anchorPoint.x, view.bounds.size.height * view.layer.anchorPoint.y); newPoint = CGPointApplyAffineTransform(newPoint, view.transform); oldPoint = CGPointApplyAffineTransform(oldPoint, view.transform); CGPoint position = view.layer.position; position.x -= oldPoint.x; position.x += newPoint.x; position.y -= oldPoint.y; position.y += newPoint.y; view.layer.position = CGPointMake(0, 0); view.layer.anchorPoint = CGPointMake(0, 0); } UIImageOrientation.up UIImage.Orientation.up SwiftOCRRecognizedBlob /Users/soralee/Documents/GitHub/opensrcOCR/framework/SwiftOCR/GPUImage-master/framework/GPUImage.xcodeproj OpenGLES is deprecated. Consider migrating to Metal instead. 원시, primitive, 기본 자료형, ... ARM Assembly Odroid, Raspberry Pi 모두 ARM Architecture based. 두 시스템을 이해하기 위한 언어로 ARM Assembly는 필수입니다. 모든 프로그래밍 언어의 기초는 "자료형", "자료구조", "Data Structure"에서 시작합니다. http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0024a/ch08s02.html ARM Information Center infocenter.arm.com 완(完)전한 프로그래밍 https://docs.swift.org/swift-book/ReferenceManual/Declarations.html#grammar_import-declaration Declarations — The Swift Programming Language (Swift 5.2) Declarations A declaration introduces a new name or construct into your program. For example, you use declarations to introduce functions and methods, to introduce variables and constants, and to define enumeration, structure, class, and protocol types. Yo docs.swift.org - (void)pinchZoom:(UIPinchGestureRecognizer *)recognizer { NSLog(@"Pinch scale: %f", recognizer.scale); if(recognizer.scale < 1) recognizer.scale = 1; CGAffineTransform transform = CGAffineTransformMakeScale(recognizer.scale, recognizer.scale); // you can implement any int/float value in context of what scale you want to zoom in or out mainPanel.transform = transform; // make these static so they can be used across gesture states static CGAffineTransform initialTransform; static CGPoint initialAnchor; if (recognizer.state == UIGestureRecognizerStateBegan) { // save these for later states initialTransform = recognizer.view.transform; initialAnchor = recognizer.view.layer.anchorPoint; // get the center point of the pinch CGPoint touch = [recognizer locationInView:mainPanel]; // anchor point is relative to the view bounds: 0 ... up to 1.0, for both x and y CGFloat anchorX = touch.x / recognizer.view.bounds.size.width; CGFloat anchorY = touch.y / recognizer.view.bounds.size.height; // set the layer anchor point AND position, to where the view was initially pinched [self setAnchorPoint:CGPointMake(anchorX,anchorY) forView:mainPanel]; } else if (recognizer.state == UIGestureRecognizerStateChanged) { // perform the pinch zoom mainPanel.transform = CGAffineTransformScale(initialTransform,recognizer.scale,recognizer.scale); } else if (recognizer.state == UIGestureRecognizerStateEnded) { // reset the scale when it's done recognizer.scale = 1; // restore the original anchor point [self setAnchorPoint:initialAnchor forView:mainPanel]; } CGRect transformedBounds = CGRectApplyAffineTransform(mainPanel.bounds, mainPanel.transform); [_scrollview setContentSize:CGSizeMake(transformedBounds.size.width, transformedBounds.size.height)]; // [_scrollview setContentSize:CGSizeMake(transformedBounds.size.width / 2.7, transformedBounds.size.height / 2.7)]; } // -(IBAction)methodCalledOnClickingUIButton:(id)sender //{ // if(sender==zoomInButton) // { // scaleValue++; // } // else if(sender==zoomOutButton) // { // scaleValue--; // } // CGAffineTransform transform = CGAffineTransformMakeScale(scaleValue,scaleValue); // self.view.transform = transform; //} - (void)handleTapGesture:(UITapGestureRecognizer *)sender { NSLog(@"handleTapGesture"); [mainPanel removeFromSuperview]; CGAffineTransform transform = CGAffineTransformMakeScale(1, 1); mainPanel.transform = transform; // mainPanel.layer.anchorPoint = CGPointMake(0, 0); [_scrollview addSubview:mainPanel]; [_scrollview setContentSize:mainPanel.bounds.size]; if (sender.state == UIGestureRecognizerStateRecognized) { } } -(UILabel *) uilabelSubViews:(NSString *)pString { UILabel *tDrawText = [[UILabel alloc] initWithFrame:CGRectMake(0.5, 0.5, 20, 10)]; tDrawText.textAlignment = UITextAlignmentCenter; [tDrawText setText:pString]; tDrawText.backgroundColor = [UIColor clearColor]; tDrawText.textColor = [UIColor whiteColor]; tDrawText.font = [UIFont boldSystemFontOfSize:8]; [tDrawText setAdjustsFontSizeToFitWidth:YES]; return tDrawText; } - (void)viewDidLoadExtracted { NSString *paramPass = @""; if(self->id_dfct_ctyp == 65535) paramPass = @"%%"; else paramPass = [NSString stringWithFormat:@"%d", self->id_dfct_ctyp]; SqlUtils *db = [[SqlUtils alloc] init]; self->listOfTheRect = [[NSMutableArray alloc] initWithCapacity:0]; [db c828ListOfStatistics:self->listOfTheRect withDongCd:@"" ctyp:paramPass]; for (statisticsCheckingCondition *s in self->listOfTheRect) { NSLog(@"statisticsCheckingCondition %@ %@ %@ %@" , s.dong , s.floor , s.hosu , s.color); } self->nsm = [[NSMutableArray alloc] initWithCapacity:0]; [db c828ListOfStatisticsTotal:self->nsm withDongCd:@"" ctyp:paramPass]; self->stc8 = [self->nsm objectAtIndex:0]; NSMutableArray *personsArray = [[NSMutableArray alloc] initWithCapacity:0]; self->column = [[db hjhHoshMaxValue:[GlobalVar loadFromUserDefaults:@"current_cd_dong"]] intValue]; self->row = (int)[db selectCountOfMaxFloor:[GlobalVar loadFromUserDefaults:@"current_cd_dong"]]; if(self->column == 0) { [GlobalVar alertMsgOKWithTitle:@"mBASS" message:@"점검현황은 전유만 조회 가능합니다."]; [self.navigationController popViewControllerAnimated:NO]; return; } mainPanel = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self->column * 42, self->row * 18)]; UIImageView *backgroundImage = [[UIImageView alloc] initWithFrame:CGRectMake(mainPanel.bounds.origin.x, mainPanel.bounds.origin.y, mainPanel.bounds.size.width, mainPanel.bounds.size.height)]; [backgroundImage setImage:[UIImage imageNamed:@"pc_bg.png"]]; [mainPanel addSubview:backgroundImage]; mainPanel.backgroundColor = [UIColor whiteColor]; NSLog(@"PresentCondition rows, columns = %d, %d", self->row, self->column); CGFloat leftMargin = 50.f; CGFloat topMargin = 50.f; CGFloat rectangleWidth = 20.0; CGFloat rectangleHeight = 10.0; CGFloat gapOfColumn = 3.0; CGFloat gapOfRow = 3.0; NSArray *items = @[@"R", @"Y", @"G"]; for(int loop4floor=0;loop4floor<=self->column;loop4floor++) { for(int j=0;j<=self->row;j++) { UIView *myBox2 = [[UIView alloc] initWithFrame:CGRectMake((rectangleWidth+gapOfColumn)*loop4floor + leftMargin , (rectangleHeight+gapOfRow) * j + topMargin, rectangleWidth, rectangleHeight)]; [myBox2 setAlpha:0.85]; //talpha //BASIC COLOR if(loop4floor == 0) { myBox2.backgroundColor = [UIColor blueColor]; // [UIColor colorWithRed:0.701960784313 green:1.0 blue:1.0 alpha:1.0]; NSString *tFloorStringsAre = [NSString stringWithFormat:@"%d층", (self->row - j)]; if([tFloorStringsAre isEqualToString:@"0층"]) tFloorStringsAre = @"층"; [myBox2 addSubview:[self uilabelSubViews:tFloorStringsAre]]; } else if(j== self->row) { myBox2.backgroundColor = [UIColor blueColor]; // [UIColor colorWithRed:0.701960784313 green:1.0 blue:1.0 alpha:1.0]; NSString *tFloorStringsAre = [NSString stringWithFormat:@"%d호", loop4floor]; if([tFloorStringsAre isEqualToString:@"0호"]) tFloorStringsAre = @"층"; [myBox2 addSubview:[self uilabelSubViews:tFloorStringsAre]]; } else myBox2.backgroundColor = [UIColor lightGrayColor]; for (statisticsCheckingCondition *s in self->listOfTheRect) { if((self->row - [s.floor intValue]) == j && [s.hosu intValue] == loop4floor) { // NSLog(@"floor %d s.hosu %d", [s.floor intValue], [s.hosu intValue]); int item = [items indexOfObject:s.color]; switch (item) { case 0: myBox2.backgroundColor = [UIColor colorWithRed:0.86275 green:0.27451 blue:0.27451 alpha:1.0]; //red // myBox2.backgroundColor = [UIColor colorWithRed:0.71372549 green:0.21568627 blue:0.2 alpha:1.0]; //red break; case 1: myBox2.backgroundColor = [UIColor colorWithRed:0.97255 green:0.80392 blue:0.46667 alpha:1.0]; // myBox2.backgroundColor = [UIColor colorWithRed:0.792156 green:0.5607843 blue:0.3098039 alpha:0.9]; break; //yellow case 2: myBox2.backgroundColor = [UIColor colorWithRed:0.4 green:0.6 blue:0.2 alpha:1.0]; //green likes // myBox2.backgroundColor = [UIColor colorWithRed:0.49411764 green:0.6196078 blue:0.30196078 alpha:1.0]; //green likes break; default: break; } } } // [self drawHosuText:myBox2.layer.position]; // [tDrawText setTag:1] [personsArray addObject:myBox2]; } } UIPinchGestureRecognizer *pointerPinchZoom = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(pinchZoom:)]; [mainPanel addGestureRecognizer:pointerPinchZoom]; for(UIView *v in personsArray) { [mainPanel addSubview:v]; } UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapGesture:)]; tapGesture.numberOfTapsRequired = 2; [mainPanel addGestureRecognizer:tapGesture]; [mainPanel removeFromSuperview]; [_scrollview addSubview:mainPanel]; // [_scrollview setContentSize:CGSizeMake(mainPanel.bounds.size.width / 2.7, mainPanel.bounds.size.height / 2.7)]; // CGAffineTransform transform = CGAffineTransformMakeScale(1.338158, 1.338158); mainPanel.transform = transform; CGRect transformedBounds = CGRectApplyAffineTransform(mainPanel.bounds, mainPanel.transform); [_scrollview setContentSize:CGSizeMake(transformedBounds.size.width, transformedBounds.size.height)]; [self onClickStatAll:nil]; } - (void)drawHosuText:(CGPoint)pPoint { UIFont* font = [UIFont fontWithName:@"Arial" size:12]; UIColor* textColor = [UIColor redColor]; NSDictionary* stringAttrs = @{ NSFontAttributeName : font, NSForegroundColorAttributeName : textColor }; NSAttributedString* attrStr = [[NSAttributedString alloc] initWithString:@"Hwfewefelwefwfelo" attributes:stringAttrs]; // UIGraphicsBeginImageContext([_scrollview contentSize]); // CGContextRef context = UIGraphicsGetCurrentContext(); [attrStr drawAtPoint:pPoint]; // UIGraphicsEndImageContext(); } - (NSInteger)dropdownMenu:(MKDropdownMenu *)dropdownMenu numberOfRowsInComponent:(NSInteger)component; { return [arrDropdown count]; } - (NSString *)dropdownMenu:(MKDropdownMenu *)dropdownMenu titleForComponent:(NSInteger)component { return [NSString stringWithFormat:@"공종 : %@", dropdownTitle]; } - (NSInteger)numberOfComponentsInDropdownMenu:(MKDropdownMenu *)dropdownMenu { return 1; } - (NSString *)dropdownMenu:(MKDropdownMenu *)dropdownMenu titleForRow:(NSInteger)row forComponent:(NSInteger)component { // NSLog(@"arrDropdown[%d] = %@", row, arrDropdown[row]); DDTBT_RGON_DFCT_CTYP *data = [[DDTBT_RGON_DFCT_CTYP alloc] init]; data = arrDropdown[row]; return data.nm_dfct_ctyp; } - (void)dropdownMenu:(MKDropdownMenu *)dropdownMenu didSelectRow:(NSInteger)row inComponent:(NSInteger)component { // NSString *colorString = self.colors[row]; // self.textLabel.text = colorString; // // UIColor *color = UIColorWithHexString(colorString); // self.view.backgroundColor = color; // self.childViewController.shapeView.strokeColor = color; // // [_mBtnCheck setUserInteractionEnabled:YES]; [mainPanel removeFromSuperview]; // [self initializeData]; [_mTexxtField setText:@""]; NSLog(@"Selected Row is %d", row); selectedData = [[DDTBT_RGON_DFCT_CTYP alloc] init]; selectedData = arrDropdown[row]; dropdownTitle = selectedData.nm_dfct_ctyp; NSLog(@"Selected Row is %d %d", row, selectedData.id_dfct_ctyp); self->id_dfct_ctyp = selectedData.id_dfct_ctyp; [dropdownMenu reloadAllComponents]; [self viewDidLoadExtracted]; delay(0.15, ^{ [dropdownMenu closeAllComponentsAnimated:YES]; }); } static inline void delay(NSTimeInterval delay, dispatch_block_t block) { dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delay * NSEC_PER_SEC)), dispatch_get_main_queue(), block); } - (void)viewDidLoad { [super viewDidLoad]; oldOne(self); [self viewDidLoadExtracted]; NSString *query = [NSString stringWithFormat:@"WITH T_CTYP AS \ ( \ SELECT ID_DFCT_CTYP, NM_DFCT_CTYP, ODER_MKAR \ FROM DDTBT_RGON_DFCT_CTYP \ GROUP BY ID_DFCT_CTYP, NM_DFCT_CTYP \ ) \ SELECT DISTINCT A.ID_DFCT_CTYP, B.NM_DFCT_CTYP \ FROM DDTBT_CPNY_NOHS_QOTA A \ INNER JOIN T_CTYP B \ ON B.ID_DFCT_CTYP = A.ID_DFCT_CTYP \ WHERE CD_DONG = '%@' \ ORDER BY B.ODER_MKAR;", [GlobalVar loadFromUserDefaults:@"current_cd_dong"]]; SqlUtils *db = [[SqlUtils alloc] init]; arrDropdown = [NSMutableArray arrayWithCapacity:0]; [db hjhSqlQuery2_seeUlater:query toArray:arrDropdown]; DDTBT_RGON_DFCT_CTYP *data111 = [[DDTBT_RGON_DFCT_CTYP alloc] init]; data111.nm_dfct_ctyp = @"전체선택"; data111.id_dfct_ctyp = 65535; [arrDropdown insertObject:data111 atIndex:0]; dropdownMenu = [[MKDropdownMenu alloc] initWithFrame:CGRectMake(_mTexxtField .frame.origin.x, self.view.frame.origin.y + _mTexxtField .frame.origin.y + 6, 164, 20)]; dropdownMenu.dataSource = self; dropdownMenu.delegate = self; [self.view addSubview:dropdownMenu]; // NSLog(@"%d %d componet count", [dropdownMenu selectedComponent], [dropdownMenu selectedRowsInComponent:[dropdownMenu selectedComponent]]); // [dropdownMenu selectRow:1 inComponent:[dropdownMenu selectedComponent]]; //=======================first launching [mainPanel removeFromSuperview]; // [self initializeData]; [_mTexxtField setText:@""]; int trow = 0; NSLog(@"Selected Row is %d", trow); selectedData = [[DDTBT_RGON_DFCT_CTYP alloc] init]; selectedData = arrDropdown[trow]; dropdownTitle = selectedData.nm_dfct_ctyp; NSLog(@"Selected Row is %d %d", trow, selectedData.id_dfct_ctyp); self->id_dfct_ctyp = selectedData.id_dfct_ctyp; [dropdownMenu reloadAllComponents]; [self viewDidLoadExtracted]; delay(0.15, ^{ [dropdownMenu closeAllComponentsAnimated:YES]; }); } -(void) refreshStatistics { NSString *ynn = @""; if (YES == [mFlag isSelected]) ynn = @"Y"; db = [[SqlUtils alloc] init]; [db hjhSearchingDefect:mList4calculatingStat withDongCd:mDongCd nohs:mNohs ynReClsfRqst:ynn idLoc:mIDLoc no_cd:[db hjhSearchingSelectNoCd:mNmCd] ctyp:[db finderCTYP:mCTYP] dateFrom:mDate1 dateTo:mDate2 isDatesAreSet:mIsDatesAreSet hndl_stat:@"" enterprise:[db selectCD_CPNY:mEnterprise] search001:mSearch001 search002:mSearch002 search003:mSearch003 sortingMethod:mSqlsortMethod publicOrH:mDokkaebi ]; [_mBtnStatAll setTitle:[NSString stringWithFormat:@" 📚%@세대", self->stc8.cl_all] forState:UIControlStateNormal]; [_mBtnStatB setTitle:[NSString stringWithFormat:@"📕%@세대", self->stc8.cl_r] forState:UIControlStateNormal]; [_mBtnStatE setTitle:[NSString stringWithFormat:@"📙%@세대", self->stc8.cl_y] forState:UIControlStateNormal]; [_mBtnStatX setTitle:[NSString stringWithFormat:@"📗%@세대", self->stc8.cl_g] forState:UIControlStateNormal]; // NSLog(@"098506738478: %d %d %d %d", total, b, e, d); // if(total != 0) { // double calc = ((double)((double)total - (double)b) / (double)total) * 100; // // [self.lblCalc setText:[NSString stringWithFormat:@"[ 조치율 : %.1f%% ]", calc]]; // [self.lblCalc setText:[NSString stringWithFormat:@" 조치율 : %.1f%% ", calc]]; // } } - (void)dealloc { //ARC [super dealloc]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationPortrait); } - (void)initializeControls { // UIBarButtonItem *btnNew = [[UIBarButtonItem alloc] initWithTitle:@"추가접수" style:UIBarButtonItemStyleDone target:self action:@selector(onNew:)]; self.navigationItem.rightBarButtonItem = GlobalVar.globalVar.globalHamberger; // NSArray *arrBtns = [[NSArray alloc]initWithObjects:btnNew, nil]; // self.navigationItem.rightBarButtonItems = arrBtns; if (nil == mListSearchingResult) { mListSearchingResult = [NSMutableArray arrayWithCapacity:0]; } if (nil == mList4calculatingStat) { mList4calculatingStat = [NSMutableArray arrayWithCapacity:0]; } } - (void)initializeData { NSLog(@"SerchingResult : initializeData mDongCD %@, hosu %@ mNmCD %@", mDongCd, mNohs, mNmCd); [mChkAll setSelected:NO]; NSString *yn = @""; if (YES == [mFlag isSelected]) yn = @"Y"; SqlUtils *db = [[SqlUtils alloc] init]; [db hjhSearchingDefect:mListSearchingResult withDongCd:mDongCd nohs:mNohs ynReClsfRqst:yn idLoc:mIDLoc no_cd:[db hjhSearchingSelectNoCd:mNmCd] ctyp:[db finderCTYP:mCTYP] dateFrom:mDate1 dateTo:mDate2 isDatesAreSet:mIsDatesAreSet hndl_stat:mAmode enterprise:[db selectCD_CPNY:mEnterprise] search001:mSearch001 search002:mSearch002 search003:mSearch003 sortingMethod:mSqlsortMethod publicOrH:mDokkaebi ]; // for(DFCT_LIST *i in mListSearchingResult) { // NSLog(@"i cd clsf 3893 %@", i.cd_loc_clsf); // } NSLog(@"[db selectNoCd:mNmCd] = %@", [db hjhSearchingSelectNoCd:mNmCd]); NSMutableDictionary *dic = [[NSMutableDictionary alloc] initWithCapacity:0]; [db selectHosh:dic withDongCd:mDongCd nohs:mNohs]; NSString *dongNm = [dic valueForKey:@"nm_dong"]; NSString *florNm = @""; NSString *ho = @"전체"; if (YES == [mDongCd isEqualToString:@""]) { dongNm = @"전체동"; } if (YES == [mNohs isEqualToString:@""]) { florNm = @"전체"; // [mLblHosh setText:[NSString stringWithFormat:@"→%@→%@층→%@호", dongNm, florNm, ho]]; } else { if (2 < [mNohs length]) { // 동층호 다 선택 [mLblHosh setText:[NSString stringWithFormat:@"→%@→%@호", dongNm, mNohs]]; } else { florNm = mNohs; [mLblHosh setText:[NSString stringWithFormat:@"→%@→%@층→%@호", dongNm, florNm, ho]]; } } if(_nflagRefreshStat) [self refreshStatistics]; _nflagRefreshStat = true; [mTableView reloadData]; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; self.title = @"점검 현황"; } static void viewDidAPPearExtracted(PresentCondition *object) { UINavigationBar *bar = [object.navigationController navigationBar]; [bar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [UIFont boldSystemFontOfSize:15.f], NSFontAttributeName, [UIColor whiteColor], UITextAttributeTextColor, nil]]; [object refreshStatistics]; NSString *currentDong = [GlobalVar loadFromUserDefaults:@"current_cd_dong"]; int cdong = [currentDong intValue]; [object->_lblDongInfo setText:[NSString stringWithFormat:@"%d 동", cdong]]; } - (void)_2viewdidappearextracted { [UIView animateWithDuration:0.0 delay:0.0 options:UIViewAnimationOptionCurveEaseIn animations:^(void) { self.view.alpha = 0.0; } completion:^(BOOL finished) { [UIView animateWithDuration:1.0 delay:0.0 options:UIViewAnimationOptionCurveEaseOut animations:^(void) { self.view.alpha = 1.0; } completion:nil]; }]; } -(void)viewDidAppear:(BOOL)animated { viewDidAPPearExtracted(self); [self _2viewdidappearextracted]; // [UIView transitionWithView:mainPanel duration:1.0 options:UIViewAnimationOptionTransitionCurlUp animations:^{ // mainPanel.hidden = YES; //// mainPanel.hidden = NO; // } completion:^(BOOL finished) { //// mainPanel.hidden = YES; // mainPanel.hidden = NO; // // }]; // // [UIView transitionFromView:(nonnull UIView *) toView:(nonnull UIView *) duration:(NSTimeInterval) options:(UIViewAnimationOptions) completion:^(BOOL finished) { // // // }] // [UIView transitionWithView:(nonnull UIView *) duration:(NSTimeInterval) options:(UIViewAnimationOptions) animations:^{ // // } completion:^(BOOL finished) { // <#code#> // }] // [UIView trans] // completion:^(BOOL finished){ // // Save the old text and then swap the views. // // 스왑을 통해 이동한 뷰나 교체한 뷰를 표시합니다. // UIView* temp = mainPanel; // mainPanel = mainPanel; // mainPanel = temp; // } // ]; } #pragma mark - #pragma mark === TableView DataSource === - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // Return the number of sections. return 1; } - (NSInteger) tableView:(UITableView *)table numberOfRowsInSection:(NSInteger)section { return [mListSearchingResult count]; } - (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"CellTableView"; NSUInteger row = [indexPath row]; DFCT_LIST *data = [mListSearchingResult objectAtIndex:row]; CGFloat margin_cd_loc_clsf = 0.0; if([data.cd_loc_clsf isEqualToString:@"P"] || data.id_dfct_cl == 10) margin_cd_loc_clsf = 23; if([data.cd_loc_clsf isEqualToString:@"P"] && data.id_dfct_cl == 10) margin_cd_loc_clsf = 58; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if( cell != nil ) { for(int i=0; i<[cell.contentView.subviews count];i++) if([cell.contentView.subviews objectAtIndex:i] != nil) [[cell.contentView.subviews objectAtIndex:i] removeFromSuperview]; } cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; UIImage *imageUp = [UIImage imageNamed:@"btn_check_o.png"]; UIImage *imageDn = [UIImage imageNamed:@"btn_check_d.png"]; UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 40, 44)]; [btn addTarget:self action:@selector(onClickCheck:) forControlEvents:UIControlEventTouchUpInside]; [btn setImage:imageUp forState:UIControlStateNormal]; [btn setImage:imageDn forState:UIControlStateSelected]; [btn setImageEdgeInsets:UIEdgeInsetsMake(11, 6, 11, 12)]; [btn setAdjustsImageWhenHighlighted:NO]; [btn setContentMode:UIViewContentModeCenter]; [btn setTag:0]; [btn setHidden:YES]; [cell.contentView addSubview:btn]; UIButton *ico = [[UIButton alloc] initWithFrame:CGRectMake(280, 5, 34, 34)]; [ico setEnabled:NO]; // ico.titleLabel.font = [UIFont systemFontOfSize:12]; [ico setTag:1]; [cell.contentView addSubview:ico]; UILabel *top = [[UILabel alloc] initWithFrame:CGRectMake(40+margin_cd_loc_clsf - 25, 2, 238-margin_cd_loc_clsf, 40)]; top.lineBreakMode = NSLineBreakByWordWrapping; top.numberOfLines = 0; top.textAlignment = UITextAlignmentLeft; top.backgroundColor = [UIColor clearColor]; top.font = [UIFont systemFontOfSize:14]; [top setAdjustsFontSizeToFitWidth:YES]; [top setTag:2]; [cell.contentView addSubview:top]; UILabel *bottom = [[UILabel alloc] initWithFrame:CGRectMake(40 - 25, 42, 238, 20)]; bottom.textAlignment = UITextAlignmentLeft; bottom.numberOfLines = 0; bottom.backgroundColor = [UIColor clearColor]; bottom.font = [UIFont systemFontOfSize:14]; [bottom setTextColor:[UIColor grayColor]]; [bottom setTag:3]; [cell.contentView addSubview:bottom]; if(data.id_dfct_cl == 10 && [data.cd_loc_clsf isEqualToString:@"P"]) { UIView *combinedView = [[UIView alloc] initWithFrame:CGRectMake(0, 2, 78, 22)]; UIButton *btnp2 = [[UIButton alloc] initWithFrame:CGRectMake(0, 2, 38, 22)]; UIImage *imageUpp2 = [UIImage imageNamed:@"icon_public.png"]; UIImage *imageDnp2 = [UIImage imageNamed:@"icon_public.png"]; [btnp2 setImage:imageUpp2 forState:UIControlStateNormal]; [btnp2 setImage:imageDnp2 forState:UIControlStateSelected]; [btnp2 setImageEdgeInsets:UIEdgeInsetsMake(4, 6, 4, 2)]; [combinedView addSubview:btnp2]; UIImage *imageUpp = [UIImage imageNamed:@"icon_public_after.png"]; UIImage *imageDnp = [UIImage imageNamed:@"icon_public_after.png"]; UIButton *btnp = [[UIButton alloc] initWithFrame:CGRectMake(35, 2, 38, 22)]; [btnp setImage:imageUpp forState:UIControlStateNormal]; [btnp setImage:imageDnp forState:UIControlStateSelected]; [btnp setImageEdgeInsets:UIEdgeInsetsMake(4, 6, 4, 2)]; [combinedView addSubview:btnp]; [btnp setTag:4]; [cell.contentView addSubview:combinedView]; }else if([data.cd_loc_clsf isEqualToString:@"P"]) { UIImage *imageUpp = [UIImage imageNamed:@"icon_public.png"]; UIImage *imageDnp = [UIImage imageNamed:@"icon_public.png"]; UIButton *btnp = [[UIButton alloc] initWithFrame:CGRectMake(0, 2, 38, 22)]; [btnp setImage:imageUpp forState:UIControlStateNormal]; [btnp setImage:imageDnp forState:UIControlStateSelected]; [btnp setImageEdgeInsets:UIEdgeInsetsMake(4, 6, 4, 2)]; [btnp setTag:4]; [cell.contentView addSubview:btnp]; } else if(data.id_dfct_cl == 10) { UIImage *imageUpp = [UIImage imageNamed:@"icon_public_after.png"]; UIImage *imageDnp = [UIImage imageNamed:@"icon_public_after.png"]; UIButton *btnp = [[UIButton alloc] initWithFrame:CGRectMake(0, 2, 38, 22)]; [btnp setImage:imageUpp forState:UIControlStateNormal]; [btnp setImage:imageDnp forState:UIControlStateSelected]; [btnp setImageEdgeInsets:UIEdgeInsetsMake(4, 6, 4, 2)]; [btnp setTag:4]; [cell.contentView addSubview:btnp]; } NSInteger cnt = [cell.contentView.subviews count]; UIButton *chkBtn = [cell.contentView.subviews objectAtIndex:0]; [chkBtn setSelected:data.isCheck]; UIButton *img = [cell.contentView.subviews objectAtIndex:1]; if (YES == [data.cd_hndl_stat isEqualToString:@"E"]) { [img setBackgroundImage:[UIImage imageNamed:@"icon04.png"] forState:UIControlStateDisabled]; [img setTitle:@"" forState:UIControlStateDisabled]; //처리 [img setTitleColor:[UIColor whiteColor] forState:UIControlStateDisabled]; } else if (YES == [data.cd_hndl_stat isEqualToString:@"B"]) { [img setBackgroundImage:[UIImage imageNamed:@"icon03.png"] forState:UIControlStateDisabled]; [img setTitle:@"" forState:UIControlStateDisabled]; //접수 [img setTitleColor:[UIColor whiteColor] forState:UIControlStateDisabled]; } else { [img setBackgroundImage:[UIImage imageNamed:@"icon05.png"] forState:UIControlStateDisabled]; [img setTitle:@"" forState:UIControlStateDisabled]; //완료 [img setTitleColor:[UIColor blackColor] forState:UIControlStateDisabled]; } for (int i=2; i<cnt; i++) { UILabel *lbl = [cell.contentView.subviews objectAtIndex:i]; switch (lbl.tag) { case 2: [lbl setText:[NSString stringWithFormat:@"%@ %@호:%@→%@→%@", data.nm_dong, data.nohs, data.nm_loc, data.nm_rgon, data.nm_dfct_type]]; break; case 3: [lbl setText:[NSString stringWithFormat:@"하자내용:%@", data.dfct_cnts]]; break; } } UIView *bgColorView = [[UIView alloc] init]; [bgColorView setBackgroundColor: [UIColor colorWithRed:0.988235 green:0.964705 blue:0.870588 alpha:1.0]]; [cell setSelectedBackgroundView:bgColorView]; return cell; } - (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { DFCT_LIST *data = [mListSearchingResult objectAtIndex:indexPath.row]; NSLog(@"selected!!!! %@", data.cd_hndl_stat); // if([data.cd_hndl_stat isEqualToString:@"X"]) { // ConfirmationEditor *v = [[ConfirmationEditor alloc] initWithNibName:@"ConfirmationEditor" bundle:[NSBundle mainBundle]]; // self.title = @""; // v.mMbilId = data.id_mbil; // v.delegate = self; // v.shouldDeleteButtonBeDELETE = YES; // if([data.cd_hndl_stat isEqualToString:@"B"]||[data.cd_hndl_stat isEqualToString:@"X"]) v.shouldConfirmButtonBeDELETE = YES; // //[v initializeData]; // // self.isFilterEnabled = false; // [self.navigationController pushViewController:v animated:NO]; // // } else { DCH_BsQtChkEdtg *v = [[DCH_BsQtChkEdtg alloc] initWithNibName:@"DCH_BsQtChkEdtg" bundle:[NSBundle mainBundle]]; v.mMbilId = data.id_mbil; v.delegate = self; if(![data.cd_hndl_stat isEqualToString:@"B"]) { v.shouldDeleteButtonBeDELETE = YES; v.shouldConfirmButtonBeDELETE = YES; } //[v initializeData]; [self.navigationController pushViewController:v animated:NO]; // else } [tableView deselectRowAtIndexPath:indexPath animated:NO]; } #pragma mark - #pragma mark ActionSheet Delegate - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{ NSLog(@"index:%i", buttonIndex); if (buttonIndex==0) { [actionSheet dismissWithClickedButtonIndex:buttonIndex animated:NO]; if (actionSheet.tag == 1) { exit(0); } else if (actionSheet.tag == 2) { [self complete]; // 확검처리 } } } #pragma mark - #pragma mark AlertView Delegate - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { NSString *cd = @""; NSSortDescriptor *sortDescriptor; switch(buttonIndex) { case 0: cd = @"동/호수 오름차순"; mSqlsortMethod = 1; [self initializeData]; return; sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"cd_dong" ascending:YES]; break; case 1: cd = @"동/호수 내림차순"; mSqlsortMethod = 2; [self initializeData]; return; sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"cd_dong" ascending:NO]; break; case 2: cd = @"등록일자 오름차순"; sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"dnt_rgst" ascending:YES]; break; case 3: cd = @"등록일자 내림차순"; sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"dnt_rgst" ascending:NO]; break; default: return; } NSMutableArray *sortedArray = [mListSearchingResult sortedArrayUsingDescriptors:@[sortDescriptor]]; // mList = sortedArray; mListSearchingResult=[NSMutableArray arrayWithArray:sortedArray]; [mTableView reloadData]; NSLog(@"%@", cd); } #pragma mark - #pragma mark Custom Methods - (IBAction)onHoshCd:(id)sender { SuperAddressSelector *v = [[SuperAddressSelector alloc] initWithNibName:@"SuperAddressSelector" bundle:[NSBundle mainBundle]]; // 리턴값 받기 위한 델리게이트 v.delegate = self; v.mIsAll = YES; v.mDongCd = mDongCd; v.mNohs = mNohs; v.isAllowUserInteraction = YES; v.istheonedataORarray = YES; [self.navigationController pushViewController:v animated:NO]; } - (IBAction)onFlag:(id)sender { NSString *stat = @""; BOOL select = [mFlag isSelected]; if (YES == select) { [mFlag setSelected:NO]; stat = @""; } else { [mFlag setSelected:YES]; stat = @"E"; } if (NO == [mLblHosh.text isEqualToString:@""]) { SqlUtils *db = [[SqlUtils alloc] init]; [db selectDfct:mListSearchingResult withDongCd:mDongCd nohs:mNohs ynReClsfRqst:@"" mode:@"" hndlStatCd:stat]; [mTableView reloadData]; } } - (IBAction)onReRcpt:(id)sender { // 체크된게 있으면... BOOL chk = NO; BOOL ing = NO; for (int i=0; i<[mListSearchingResult count]; i++) { DFCT_LIST *data = [mListSearchingResult objectAtIndex:i]; // 체크되고 처리중인것 if (YES == data.isCheck) { chk = YES; if (YES == [data.cd_hndl_stat isEqualToString:@"E"]) { ing = YES; break; } } } if (NO == chk) { [GlobalVar alertMsgOKWithTitle:@"mBASS" message:@"선택된 건이 없습니다."]; return; } if (NO == ing) { //[GlobalVar alertMsgOKWithTitle:@"mBASS" message:@"미완료건을 선택하세요."]; [GlobalVar alertMsgOKWithTitle:@"mBASS" message:@"확검 완료된 건이나 신규접수 건은 재접수 처리를 할 수 없습니다. [-0322]"]; return; } UIAlertView *prompt = [[UIAlertView alloc] initWithTitle:@"재접수 사유" message:@"" // 중요!! 칸을 내려주는 역할을 합니다. delegate:self cancelButtonTitle:@"취소" otherButtonTitles:@"작업미진", @"재분류", @"허위보고", nil]; [prompt setTag:2]; /* NSArray *itemArray = [NSArray arrayWithObjects: @"허위보고", @"작업미진", @"재분류", nil]; UISegmentedControl *seg = [[UISegmentedControl alloc] initWithItems:itemArray]; [seg setFrame:CGRectMake(12.0, 50.0, 180.0, 25.0)]; [seg setSegmentedControlStyle:UISegmentedControlStylePlain]; [seg setSelectedSegmentIndex:0]; UIFont *font = [UIFont boldSystemFontOfSize:12.0f]; NSDictionary *attributes = [NSDictionary dictionaryWithObject:font forKey:UITextAttributeFont]; [seg setTitleTextAttributes:attributes forState:UIControlStateNormal]; [seg setTag:101]; [prompt addSubview:seg]; UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 85.0, 260.0, 25.0)]; [textField setBackgroundColor:[UIColor whiteColor]]; [textField setPlaceholder:@"사유"]; [textField setText:@""]; [textField setTag:102]; [prompt addSubview:textField]; */ // AlertView의 위치를 이동 시켜 줌. //[prompt setTransform:CGAffineTransformMakeTranslation(0.0, 110.0)]; prompt.alertViewStyle = UIAlertViewStylePlainTextInput; [prompt show]; } - (IBAction)onHome:(id)sender { [self.navigationController popViewControllerAnimated:NO]; } - (IBAction)onAtrList:(id)sender { [self.navigationController popToViewController: [self.navigationController.viewControllers objectAtIndex: 1] animated:NO]; } - (IBAction)onLogout:(id)sender { //[self.navigationController popToRootViewControlleranimated:NO]; UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"프로그램을 종료하시겠습니까?" delegate:self cancelButtonTitle:@"아니오" destructiveButtonTitle:@"예" otherButtonTitles:nil]; actionSheet.tag = 1; [actionSheet showInView:self.view]; } - (void)onComplete:(id)sender { // 체크된게 있으면... BOOL chk = NO; BOOL ing = NO; for (int i=0; i<[mListSearchingResult count]; i++) { DFCT_LIST *data = [mListSearchingResult objectAtIndex:i]; // 체크되고 처리중인것 if (YES == data.isCheck) { chk = YES; if (YES == [data.cd_hndl_stat isEqualToString:@"E"]) { ing = YES; break; } } } if (NO == chk) { [GlobalVar alertMsgOKWithTitle:@"mBASS" message:@"선택된 건이 없습니다."]; return; } if (NO == ing) { //[GlobalVar alertMsgOKWithTitle:@"mBASS" message:@"미완료건을 선택하세요."]; [GlobalVar alertMsgOKWithTitle:@"mBASS" message:@"확검 완료된 건이나 신규접수 건은 확검 처리를 할 수 없습니다. [-0704]"]; return; } UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"완료 처리하시겠습니까?" delegate:self cancelButtonTitle:@"아니오" destructiveButtonTitle:@"예" otherButtonTitles:nil]; actionSheet.tag = 2; [actionSheet showInView:self.view]; } - (void)complete { SqlUtils *db = [[SqlUtils alloc] init]; NSMutableArray *arr = [NSMutableArray arrayWithCapacity:0]; // 확검 for (int i=0; i<[mListSearchingResult count]; i++) { DFCT_LIST *data = [mListSearchingResult objectAtIndex:i]; if (YES == data.isCheck && YES == [data.cd_hndl_stat isEqualToString:@"E"]) { // 체크된거만 확검 data.cd_hndl_stat = @"X"; //[db updateDfctComplete:data.id_mbil]; [arr addObject:data]; } data.isCheck = NO; } [db updateDfctCompleteArr:arr]; // 하자 상태별 건수 [self setDfctCount]; [mTableView reloadData]; [mChkAll setSelected:NO]; } - (void)onNew:(id)sender { DCH_BsQtChk *v = [[DCH_BsQtChk alloc] initWithNibName:@"DCH_BsQtChk" bundle:[NSBundle mainBundle]]; v.mDongCd = mDongCd; v.mNohs = mNohs; [self.navigationController pushViewController:v animated:NO]; } - (void)onClickCheck:(id)sender { UITableViewCell *cell; UITableView *tv; cell = (UITableViewCell*)[[sender superview] superview]; tv = (UITableView*)cell.superview; NSIndexPath *path=[tv indexPathForCell:cell]; DFCT_LIST *data = [mListSearchingResult objectAtIndex:path.row]; data.isCheck = !data.isCheck; UIButton *btn = sender; [btn setSelected:data.isCheck]; // 전체체크해서 전체체크버튼 정리.. [self checkAllChkBox]; } - (IBAction)clickCheckAll:(id)sender { BOOL chk = NO; if (YES == [mChkAll isSelected]) { [mChkAll setSelected:NO]; chk = NO; } else { [mChkAll setSelected:YES]; chk = YES; } [self checkAllList:chk]; [mTableView reloadData]; } - (void)checkAllList:(BOOL)isChk { DFCT_LIST *data = nil; for (int i=0; i<[mListSearchingResult count]; i++) { data = [mListSearchingResult objectAtIndex:i]; data.isCheck = isChk; } } - (void)checkAllChkBox { DFCT_LIST *data = nil; BOOL ret = NO; for (int i=0; i<[mListSearchingResult count]; i++) { data = [mListSearchingResult objectAtIndex:i]; ret = YES; if (NO == data.isCheck) { ret = NO; break; } } [mChkAll setSelected:ret]; } -(void) baseViewSetData:(NSDictionary *)dic { NSLog(@"SerchingResult : baseViewSetData mDongCD %@, hosu %@", mDongCd, mNohs); NSLog(@"baseViewSetData on SearchingResult"); NSString *dongCd = [dic valueForKey:@"cd_dong"]; NSString *dongNm = [dic valueForKey:@"nm_dong"]; NSString *florCd = [dic valueForKey:@"cd_flor"]; NSString *florNm = [dic valueForKey:@"nm_flor"]; NSString *locClsfCd = [dic valueForKey:@"cd_loc_clsf"]; NSString *nohs = [dic valueForKey:@"nohs"]; NSString *ho = [dic valueForKey:@"ho"]; NSString *tppgCd = [dic valueForKey:@"cd_tppg"]; // 동층호정보 if (YES == [nohs isEqualToString:@""]) { [mLblHosh setText:[NSString stringWithFormat:@"→%@→%@→%@호", dongNm, florNm, ho]]; if (NO == [florCd isEqualToString:@""]) { nohs = florCd; } } else { [mLblHosh setText:[NSString stringWithFormat:@"→%@→%@호", dongNm, nohs]]; } NSString *yn = @""; if (YES == [mFlag isSelected]) yn = @"Y"; mDongCd = dongCd; mNohs = nohs; // 동층호 정보를 가져왔으면 // 조건에 맞는 하자들을 조회한다. SqlUtils *db = [[SqlUtils alloc] init]; [db selectDfct:mListSearchingResult withDongCd:dongCd nohs:nohs ynReClsfRqst:yn mode:@"" hndlStatCd:@""]; // 하자 상태별 건수 [self setDfctCount]; [mTableView reloadData]; [mChkAll setSelected:NO]; } // 화면 재조회로 사용하자...1 - (void) baseViewSetData1:(NSDictionary *)dic { [self initializeData]; } - (void)setValueDong:(NSString*)dong { mDongCd = dong; } - (void)setValueHosu:(NSString*)hosu { mNohs = hosu; } -(void)setNoCd:(NSString *)nocd { mNmCd = nocd; } -(void)setNmLoc:(NSString *)nmloc { mNmLoc = nmloc; SqlUtils *db = [[SqlUtils alloc] init]; if([mNmLoc isEqualToString:@""]) mIDLoc = 0; else mIDLoc = [db finderId_Loc:nmloc]; NSLog(@"Searching Result's mIDLOC = %d", mIDLoc); } -(void)setCTYP:(NSString *)ctyp { mCTYP = ctyp; } -(void)setEnterprise:(NSString *)enterprise { mEnterprise = enterprise; } -(void)setSearch001:(NSInteger )param { mSearch001 = param; } -(void)setSearch002:(NSInteger )param { mSearch002 = param; } -(void)setSearch003:(NSInteger )param { mSearch003 = param; } -(void)setDokkaebi:(NSString *)param { mDokkaebi = param; } -(void)setDates:(NSDate *)date1 toDate:(NSDate *)date2 { mDate1 = date1; mDate2 = date2; } -(void)setIsDatesAreSet:(bool)t { mIsDatesAreSet = t; } - (IBAction)onClickSorting:(id)sender { NSLog(@"onClickSorting"); UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"정렬" message:@"" delegate:self cancelButtonTitle:nil otherButtonTitles:@"동/호수 오름차순", @"동/호수 내림차순", @"등록일자 오름차순", @"등록일자 내림차순", nil]; alert.alertViewStyle = UIAlertViewStyleDefault; [alert show]; } -(void)setAmode:(NSString *)amode { mAmode = amode; } - (IBAction)onClickAddingNewOne:(id)sender { if(mNohs == nil || [mNohs isEqualToString:@""]) { QualityControl *v = [[QualityControl alloc] initWithNibName:@"QualityControl" bundle:[NSBundle mainBundle]]; self.title = @""; [self.navigationController pushViewController:v animated:NO]; GlobalVar.globalVar.globalcounterofstack4frontview++; } else { DCH_BsQtChk *v = [[DCH_BsQtChk alloc] initWithNibName:@"DCH_BsQtChk" bundle:[NSBundle mainBundle]]; v.mDongCd = mDongCd; v.mNohs = mNohs; [self.navigationController pushViewController:v animated:NO]; GlobalVar.globalVar.globalcounterofstack4frontview++; } } - (IBAction)onClickStatAll:(id)sender { [self setAmode:@""]; [self initializeData]; [_mBtnStatAll setBackgroundColor:UIColor.clearColor]; [_mBtnStatB setBackgroundColor:UIColor.clearColor]; [_mBtnStatE setBackgroundColor:UIColor.clearColor]; [_mBtnStatX setBackgroundColor:UIColor.clearColor]; } - (IBAction)onClickStatB:(id)sender { [self setAmode:@"B"]; _nflagRefreshStat = false; [self initializeData]; [_mBtnStatB setBackgroundColor: [UIColor colorWithRed:0.988235 green:0.964705 blue:0.870588 alpha:1.0]]; [_mBtnStatAll setBackgroundColor:UIColor.clearColor]; [_mBtnStatE setBackgroundColor:UIColor.clearColor]; [_mBtnStatX setBackgroundColor:UIColor.clearColor]; preferences = [[RCEasyTipPreferences alloc] initWithDefaultPreferences]; preferences.shouldDismissOnTouchOutside = YES; preferences.drawing.backgroundColor = [UIColor colorWithRed:0.71372549 green:0.21568627 blue:0.2 alpha:1.0]; preferences.drawing.arrowPostion = Bottom; preferences.animating.showDuration = 1.0; preferences.animating.dismissDuration = 1.0; preferences.animating.dismissTransform = CGAffineTransformMakeTranslation(0, -15); preferences.animating.showInitialTransform = CGAffineTransformMakeTranslation(0, -15); RCEasyTipView *tipView = [[RCEasyTipView alloc] initWithPreferences:preferences]; tipView.text = @"하자(접수, 처리) 존재 하고 완료 없을 때"; [tipView showAnimated:YES forView:_mBtnStatB withinSuperView:self.view]; } - (IBAction)onClickStatE:(id)sender { [self setAmode:@"E"]; _nflagRefreshStat = false; [self initializeData]; [_mBtnStatE setBackgroundColor: [UIColor colorWithRed:0.988235 green:0.964705 blue:0.870588 alpha:1.0]]; [_mBtnStatAll setBackgroundColor:UIColor.clearColor]; [_mBtnStatB setBackgroundColor:UIColor.clearColor]; [_mBtnStatX setBackgroundColor:UIColor.clearColor]; preferences = [[RCEasyTipPreferences alloc] initWithDefaultPreferences]; preferences.shouldDismissOnTouchOutside = YES; preferences.drawing.backgroundColor = [UIColor colorWithRed:0.792156 green:0.5607843 blue:0.3098039 alpha:1.0]; preferences.drawing.arrowPostion = Bottom; preferences.animating.showDuration = 1.0; preferences.animating.dismissDuration = 1.0; preferences.animating.dismissTransform = CGAffineTransformMakeTranslation(0, -15); preferences.animating.showInitialTransform = CGAffineTransformMakeTranslation(0, -15); RCEasyTipView *tipView = [[RCEasyTipView alloc] initWithPreferences:preferences]; tipView.text = @"하자(접수, 처리) 존재 하고 완료도 존재 할 때"; [tipView showAnimated:YES forView:_mBtnStatE withinSuperView:self.view]; } - (IBAction)onClickStatX:(id)sender { [self setAmode:@"X"]; _nflagRefreshStat = false; [self initializeData]; [_mBtnStatX setBackgroundColor: [UIColor colorWithRed:0.988235 green:0.964705 blue:0.870588 alpha:1.0]]; [_mBtnStatAll setBackgroundColor:UIColor.clearColor]; [_mBtnStatB setBackgroundColor:UIColor.clearColor]; [_mBtnStatE setBackgroundColor:UIColor.clearColor]; preferences = [[RCEasyTipPreferences alloc] initWithDefaultPreferences]; preferences.shouldDismissOnTouchOutside = YES; preferences.drawing.backgroundColor = [UIColor colorWithRed:0.49411764 green:0.6196078 blue:0.30196078 alpha:1.0]; preferences.drawing.arrowPostion = Bottom; preferences.animating.showDuration = 1.0; preferences.animating.dismissDuration = 1.0; preferences.animating.dismissTransform = CGAffineTransformMakeTranslation(0, -15); preferences.animating.showInitialTransform = CGAffineTransformMakeTranslation(0, -15); RCEasyTipView *tipView = [[RCEasyTipView alloc] initWithPreferences:preferences]; tipView.text = @"하자(접수, 처리) 없을 때"; [tipView showAnimated:YES forView:_mBtnStatX withinSuperView:self.view]; } - (UIView *)viewForZoomingInScrollView:(UIScrollView *)param { NSLog(@"1"); return param; } @end Reinforcement learning is the machine learning technique which drives AWS DeepRacer. Learn the basics of RL and how you’ll use this to create and optimize your models to compete in the AWS DeepRacer League. AWS 서비스 리소스 그룹 daelim 버지니아 북부 지원 Integer between 3 and 10. Learning rate Real number between 0.00000001 (1e-8) and 0.001 (1e-3). Entropy Real number between 0 and 1. Discount factor Real number between 0 and 1. Loss type Mean square error Huber Number of experience episodes between each policy-updating iteration Integer between 5 and 100. Stop conditionsInfo Set the conditions for your training job to stop. To avoid run-away jobs, you can limit the length of a job to within a maximum time period (Maximum time). The training will stop when the specified criteria is met. When your model has stopped training, you will be able to clone your model to start training again using new parameters. Maximum time Maximum time must be between 5 and 1440 minutes. An EC2 instance will be provisioned to train your model with Amazon SageMaker and the AWS RoboMaker. It will take about 6 minutes before your training will start, after which you will incur a cost for the training. The estimated cost per training hour starts at $3.36. Charges depend on the track and required RoboMaker Simulation Units. With Free Tier, you will receive $30 of service credits so that your first model creation, evaluation, and submission to the virtual circuit is free. You can track your monthly costs in the AWS Billing Dashboard. To learn more about our Free Tier, please visit our pricing page . CancelPreviousCreate model 의견 한국어 이용 약관개인 정보 보호 정책© 2008 - 2020, Amazon Web Services, Inc. 또는 계열사. All rights reserved. (수학-1) 선형대수와 수열 총점 10/10 제출 여부 확인을 위하여 Google Classroom 에 등록된 구글 계정(Gmail) 을 입력해주세요. 이메일 주소 * speedpointer@gmail.com 강의 영상에서 소개된 그리스 문자에서 '알파벳 대문자', '알파벳 소문자', '영어 표기법' 을 종이(태블릿 필기앱) 에 써보고 사진을 찍어(캡처) 업로드 해주세요. 강의 자료 웹페이지에 가셔서 필기 해주시면 됩니다. 참고 URL : https://datascienceschool.net/view-notebook/e943c350244842a99ab4503fa50b8a6b/ 5/5 캡션 없는 이미지 이미지 02 - 정의와진실튜브.jpeg 머신러닝 관점에서 선형대수에 대해 간략하게 정리해주세요. * 강의 영상 09:35 에 강사님께서 선형대수에 관하여 설명해주십니다. 해당 내용에 관하여 정리해주세요. '머신러닝 선형대수' 라는 키워드로 웹페이지 등을 검색하여 내용을 덧붙이셔도 좋습니다. 2/2 다른 데이터 사이언티스트와 간결, 명확한 커뮤니케이션을 위한 기술용어. 의견 보내기 데이터 분석 관점에서 우리는 데이터를 다룹니다. 데이터는 복잡하고 많고 많이 해야 합니다. 이런 작업을 위한 기술용어를 뜻합니다. 여기서 기술용어는 여러 사람과 작업을 오해 없이 정확하게 일을 할 수 있게 해주는 일종의 규칙이라고 할 수 있습니다. 즉, 가장 기본 중에 기본이 된다고 할 수 있습니다. 현실 세계에서의 '예측' 과 머신러닝에서의 '예측' 이 무엇이 다른지 설명해주세요. * 1/1 현실 예측은 미래 시점의 예견을 말하지만 머신러닝에서의 예측은 현재 시점에서 원하는 결과를 얻는 것. 의견 보내기 현실 세계에서 예측은 미래 시점에서 어떠한 일이 일어날지에 대한 것이라면, 머신러닝에서 예측은 미래에 대한 얘기는 없고, 데이터를 입력하면 어떠한 결과가 출력되는지에 대한 것을 의미합니다. 머신러닝에서 최적화에 대해 간략하게 설명해주세요. * 1/1 원하는 결과치에 최대한 근접하게 갈 수 있는 함수의 특성을 미적분 등을 통해 찾는 것. 의견 보내기 예측 문제를 풀기 위해 여러 개 함수를 만들어 냈습니다. 각 함수마다 좋은 함수를 선택할 수 있는 기준점이 있다면 가장 좋은 함수를 고를 수 있을 것입니다. 그래서 각 함수에 어떤 입력을 넣으면 출력이 커지는지 작아지는지를 찾아내는 것을 최적화라고 합니다. 확률론에 대해 간략하게 설명해주세요. * 1/1 현실 세계 문제에 대한 해답은 명확하게 '맞다' 혹은 '아니다' 식으로 둘로 나눌 수 없는 상황이 많음. 현실 문제 해답을 찾기 위해 해답에 이르는 경우의 수를 수학식으로 계산하는 것. 의견 보내기 고전 논리학에서 명제는 100% 진실 혹은 0% 진실을 말하지만, 근대 논리학 확률론에서 명제는 숫자로 표현되는 진실성을 가집니다. 이 설문지는 FAST CAMPUS 내부에서 생성되었습니다. Google 설문지 :set nu - (void)dealloc { //ARC [super dealloc]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } // for(DFCT_LIST *i in mListSearchingResult) { // NSLog(@"i cd clsf 3893 %@", i.cd_loc_clsf); // } NSString *query = [NSString stringWithFormat:@"WITH T_CTYP AS \ ( \ SELECT ID_DFCT_CTYP, NM_DFCT_CTYP, ODER_MKAR \ FROM DDTBT_RGON_DFCT_CTYP \ GROUP BY ID_DFCT_CTYP, NM_DFCT_CTYP \ ) \ SELECT DISTINCT A.ID_DFCT_CTYP, B.NM_DFCT_CTYP \ FROM DDTBT_STATUS A \ INNER JOIN T_CTYP B \ ON B.ID_DFCT_CTYP = A.ID_DFCT_CTYP \ WHERE CD_DONG = '%@' \ ORDER BY B.ODER_MKAR;", [GlobalVar loadFromUserDefaults:@"current_cd_dong"]]; //FROM DDTBT_CPNY_NOHS_QOTA A \ with t_dfct as ( \ select a.cd_dong, a.cd_flor, a.ho, \ sum(case b.cd_hndl_stat when 'B' then 1 else 0 end ) as cnt_b, \ sum(case b.cd_hndl_stat when 'E' then 1 else 0 end ) as cnt_e, \ sum(case b.cd_hndl_stat when 'X' then 1 else 0 end ) as cnt_x from ddtbt_hosh a \ left outer join ddtbt_dfct b \ on b.cd_dong = a.cd_dong \ and b.nohs = a.nohs \ and b.id_dfct_ctyp like '%@' \ where a.cd_dong = '%@' \ group by a.cd_dong, a.cd_flor, a.ho \ ) \ select cd_dong, cd_flor, ho, \ case when (cnt_b + cnt_e) > 0 \ then case cnt_x when 0 then 'R' else 'Y' end \ else 'G' \ end cl_stat \ from t_dfct \ order by cd_flor desc, ho asc;" AWS 서비스 리소스 그룹 daelim AWS DeepRacer Your models test002 test002 Delete Clone Download model Submit to virtual race TrainingInfo Completed EvaluationInfo Stop evaluation Start evaluation Training complete. You can now evaluate your model's performance. Evaluate the trained model by having the agent race against the clock along a chosen track in simulation. See how your model performs in any environment. Training configuration Environment simulation re:Invent 2018 Reward function Show Action space Show Framework Tensorflow Reinforcement learning algorithm PPO Hyperparameter Value Gradient descent batch size 64 Entropy 0.01 Discount factor 0.999 Loss type Huber Learning rate 0.0003 Number of experience episodes between each policy-updating iteration 20 Number of epochs 10 // [UIView transitionWithView:mainPanel duration:1.0 options:UIViewAnimationOptionTransitionCurlUp animations:^{ // mainPanel.hidden = YES; //// mainPanel.hidden = NO; // } completion:^(BOOL finished) { //// mainPanel.hidden = YES; // mainPanel.hidden = NO; // // }]; // // [UIView transitionFromView:(nonnull UIView *) toView:(nonnull UIView *) duration:(NSTimeInterval) options:(UIViewAnimationOptions) completion:^(BOOL finished) { // // // }] // [UIView transitionWithView:(nonnull UIView *) duration:(NSTimeInterval) options:(UIViewAnimationOptions) animations:^{ // // } completion:^(BOOL finished) { // <#code#> // }] // [UIView trans] // completion:^(BOOL finished){ // // Save the old text and then swap the views. // // 스왑을 통해 이동한 뷰나 교체한 뷰를 표시합니다. // UIView* temp = mainPanel; // mainPanel = mainPanel; // mainPanel = temp; // } // ]; { NSLog(@"hjhURLERROR Opened url"); // [GlobalVar alertMsgOKWithTitle:@"mBASS" message:@"BIM을 먼저 설치 해 주세요."]; UIAlertController *AlertView = [UIAlertController alertControllerWithTitle:@"DAELIM" message:@"하자 위치정보 입력 앱 설치가 필요합니다. 다운로드 페이지로 이동하시겠습니까?" preferredStyle:UIAlertControllerStyleActionSheet]; UIAlertAction *ok = [UIAlertAction actionWithTitle:@"확인" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { //쉐일즈비에스salesbstest [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://salesbs.daelim.co.kr/app/download_bim.html"]]; [AlertView dismissViewControllerAnimated:NO completion:nil]; }]; UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"취소" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { [AlertView dismissViewControllerAnimated:NO completion:nil]; }]; [AlertView addAction:ok]; [AlertView addAction:cancel]; [self presentViewController:AlertView animated:NO completion:nil]; }

'Blog History' 카테고리의 다른 글

245  (0) 2020.05.13
244  (0) 2020.05.13
242  (0) 2020.05.13
241  (0) 2020.05.12
240  (0) 2020.05.11

+ Recent posts